Skip to content

[NO-JIRA] Deliver subdirectory hints in tool responses instead of the system prompt (R20) - #29

Merged
johnnymo87 merged 1 commit into
patched/v1.60.2from
r20-subdir-hints-in-conversation
Nov 22, 2026
Merged

johnnymo87 merged 1 commit into
patched/v1.60.2from
r20-subdir-hints-in-conversation

Conversation

@johnnymo87

Copy link
Copy Markdown
Owner

Description

Port of fork #13 onto v1.60.2 (R20, bead workstation-6w7i.26.4.7). Subdirectory hints no longer change the system prompt, so touching a new directory no longer invalidates the prompt cache.

  • Hints are delivered once, appended to the last successful tool result of the batch that touched the directory, as an assistant-only block in the 1.54 format (Repository instructions … <subdirectory-hints dir="…">). Sessions already carrying 1.54 markers do not get them a second time.
  • Delivery depends only on the stored conversation. Directories come from agent-visible tool requests, as upstream's do. A hint counts as delivered while its block sits in an agent-visible tool result. After compaction a hint returns with the first call into its directory. honk /undo (R21) removes the block together with the calls that found the directory.
  • Fork code lives in state_machine/subdirectory_hints.rs. The upstream files only route ToolExecution::run through it and drop hints from prompt_parts.
  • Tests: 6 unit tests, plus the updated upstream prompt_and_skill_lifecycle, which now asserts the hint is not in the system prompt and appears exactly once in the input across two turns. All of them are in patched-test.yml.

Known and unchanged from 1.54: PostToolUse hooks and chat-history search now see hint text, because it lives in tool results. The context report's "Subdirectory hints" category under additional instructions no longer fills; those tokens count as tool output.

Merge order (bead workstation-6w7i.26.4): after R21, R11 and R12.

References

  • Bead workstation-6w7i.26.4.7

johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from a4af789 to 99508ed Compare November 22, 2026 06:16
johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from 99508ed to a1f1974 Compare November 22, 2026 06:56
johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from a1f1974 to ca3dffd Compare November 22, 2026 07:46
johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from ca3dffd to cab065c Compare November 22, 2026 08:56
johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from cab065c to 430db25 Compare November 22, 2026 10:16
johnnymo87 added a commit that referenced this pull request Nov 22, 2026
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from 430db25 to d836275 Compare November 22, 2026 11:37
… system prompt (R20)

v1.60.2 folds subdirectory hints into the system prompt, rebuilt each turn
from the agent-visible tool requests. The prompt changes whenever a new
directory is touched, or when compaction drops the call that found one, and
each change invalidates the provider's prompt cache from the system prompt on.

Hints now go once into the last successful tool result of the batch that
needs them, as an assistant-only text block in the 1.54 format (lead-in plus a
<subdirectory-hints dir="..."> marker), so sessions migrated from 1.54 do not
get them twice. Delivery is a pure function of the stored conversation, with
no in-memory state to requeue: directories come from agent-visible tool
requests, as upstream's did, and a hint counts as delivered while its hint
block is in an agent-visible tool result (a marker quoted elsewhere does not
count). After compaction a hint returns with the first call into its
directory; truncation (honk /undo) removes the block with the calls that
found the directory.

X-Shepherd-Wake: #29
@johnnymo87
johnnymo87 force-pushed the r20-subdir-hints-in-conversation branch from d836275 to ed3dce9 Compare November 22, 2026 11:49
@johnnymo87
johnnymo87 merged commit ab13c5f into patched/v1.60.2 Nov 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant