Skip to content

Commit 81174a8

Browse files
committed
Explain: Improve phrasing around the last-value tool's output.
We don't need to echo the "Now" part of the tool's output when it occurs, it's better to write something more descriptive. The prompting can drop explanations of the output format, which is now composed specifically for the LLM's benefit.
1 parent 19b89ae commit 81174a8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

explain/explain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ def _call_handler(_):
355355

356356
message = result_forwards.output
357357

358-
if m := re.search(r".*Now =.*", message):
358+
if m := re.search(r".*Now = (.*)", message):
359359
# If we found a value change, extract just the "Now =" part of the message.
360-
message = m[0]
360+
message = f"has just been assigned value {m[1]}"
361361

362362
# Put short messages on the same line as "Expression changed".
363363
separator = " " if len(message.splitlines()) == 1 else "\n"

explain/instructions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ source lines:
9393
This works even when the memory location was modified a long time ago or in a
9494
different function.
9595

96-
When `last` returns it specifies a "Was" value, which is what you were
97-
investigating. "Now" is the previous value, which should be ignored or used
98-
for a new debugging hypothesis.
99-
10096
`last` will only work for values that are currently in scope. If a value is not
10197
currently in scope then you need to navigate backwards in time until it is. Using
10298
`reverse_step`, `reverse_next` and `reverse_finish` can help you work

0 commit comments

Comments
 (0)