Skip to content

fix: replace vague ledger-capture guidance with concrete criteria#5

Open
grzegorznowak wants to merge 2 commits into
agenticoding:mainfrom
grzegorznowak:improve-handoff-ledger-prompt
Open

fix: replace vague ledger-capture guidance with concrete criteria#5
grzegorznowak wants to merge 2 commits into
agenticoding:mainfrom
grzegorznowak:improve-handoff-ledger-prompt

Conversation

@grzegorznowak
Copy link
Copy Markdown
Contributor

What

Replaces the ambiguous "if needed" phrasing in two locations where the LLM is instructed to save ledger entries before calling handoff:

Location Before After
/handoff command injected message "capture any reusable state in the ledger if needed" "capture any reusable state in the ledger that aligns with the direction above"
handoff promptGuidelines "Capture reusable state in the ledger if needed" "Capture reusable state in the ledger that the next context will need"

Why

"If needed" puts the burden on the LLM to guess what "needed" means with no referent. Both replacements give a concrete anchor the LLM can reason against: the user's explicit direction (command path) or the needs of the next clean context (autonomous path).

Files changed

  • handoff/command.ts — injected user message
  • handoff/tool.ts — promptGuidelines bullet

Compatibility

Neither string is consumed by any downstream code. The enforcement pipeline (pendingRequestedHandoff.toolCalled) uses boolean flags only. The injected message is pure LLM prompt text.

- /handoff command: 'if needed' → 'that aligns with the direction above'
- handoff promptGuidelines: 'if needed' → 'that the next context will need'

Both changes replace the ambiguous 'if needed' with phrases that
anchor ledger capture to a specific referent the LLM can reason about:
the user's explicit direction (command) or the next clean context
(autonomous handoff).
@grzegorznowak
Copy link
Copy Markdown
Contributor Author

@ofriw a small PR that removes some vagueness from the handoff prompt. Not sure if it will improve anything but I feel like not being strict in this phase is not what we want

@ofriw
Copy link
Copy Markdown
Contributor

ofriw commented May 26, 2026

First review passes, just need a merge with main

…r-prompt

# Conflicts:
#	handoff/command.ts
#	handoff/tool.ts
@grzegorznowak
Copy link
Copy Markdown
Contributor Author

Merged latest origin/main into this branch and resolved the notebook/handoff prompt conflicts.

Resolution keeps the notebook terminology/topic reset semantics from main while preserving the concrete handoff anchors from this PR:

  • /handoff: durable notebook capture must align with the direction above.
  • handoff tool guidance: promote durable grounding knowledge that the next context will need.

Validation:

  • node --experimental-strip-types --loader /tmp/pi-agenticoding-test-loader.mjs --test agenticoding.test.ts (127 passed)

Merge commit pushed: b7363e8.

@grzegorznowak
Copy link
Copy Markdown
Contributor Author

conflicts resolved @ofriw

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.

2 participants