Reviewed PR description, comments, commits, and linked issues.
UnderstandAnalyzed relevant source files and code diffs.
UnderstandFixed issues and updated the branch.
EditConfirmed fixes and branch cleanliness.
VerifyMerged PR into main and cleaned up branch.
CleanupYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/787
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
Let me read the relevant source files to understand the full context:
Let me read more of the types file and check how appendLabelChange works:
Let me check the other places that use navigateTree to verify consistency:
Let me check for any tests and documentation that might need updates:
Now let me run the type check to see if there are any type errors with the current PR:
PR: https://github.com/badlogic/pi-mono/pull/787
Changelog:
Good:
agent-session.ts for passing replaceInstructions and label options through the navigation flowcustomInstructions, replaceInstructions, and label via SessionBeforeTreeResult return value from session_before_tree handlersTreePreparation event data now includes the options so extensions have full visibilityBad:
Missing type update: ExtensionCommandContext.navigateTree (types.ts:240) still has old signature { summarize?: boolean }. Extensions calling ctx.navigateTree() won't have type-safe access to the new options. Only ExtensionCommandContextActions was updated.
Missing handler updates: print-mode.ts:97-98 and rpc-mode.ts:313-314 don't pass the new options through to session.navigateTree(). They only pass { summarize: options?.summarize }, dropping any customInstructions, replaceInstructions, or label options.
No tests: No tests for the new replaceInstructions, label, or extension override behavior.
Documentation not updated:
docs/extensions.md:729+ - shows only summarize optiondocs/sdk.md:113 - old signaturedocs/tree.md:108+ - old interface definitions for navigateTree, TreePreparation, and SessionBeforeTreeResultUgly:
ExtensionCommandContext.navigateTree (not updated) and ExtensionCommandContextActions.navigateTree (updated) means extensions will get TypeScript errors if they try to use the new options, but the runtime code will actually work (runner.ts:349 passes options through). This is a footgun.Questions or Assumptions:
Change summary:
agent-session.ts: navigateTree() now accepts replaceInstructions and label options. Label is attached via sessionManager.appendLabelChange() to either the summary entry or target entry.branch-summarization.ts: generateBranchSummary() now accepts replaceInstructions option. When true, customInstructions completely replaces the default BRANCH_SUMMARY_PROMPT instead of being appended as "Additional focus".types.ts: TreePreparation and SessionBeforeTreeResult interfaces extended with new fields. ExtensionCommandContextActions.navigateTree updated.runner.ts: NavigateTreeHandler type updated with new options.interactive-mode.ts: Handler implementation now passes all new options through.Tests:
agent-session-tree-navigation.test.ts tests navigation and summarization but doesn't cover the new options.replaceInstructions, label, or extension override scenarios.ok, check out into a local branch, fix up the things you identified.
Now let me update the documentation:
Now let me add the changelog entry:
Now let me run the check to verify everything compiles:
All checks pass. Here's a summary of the fixes:
Fixed:
ExtensionCommandContext.navigateTree type (types.ts:240) - Now includes customInstructions, replaceInstructions, and label options so extensions get type-safe access
print-mode.ts handler - Now passes all new options through to session.navigateTree()
rpc-mode.ts handler - Now passes all new options through to session.navigateTree()
Documentation updates:
docs/extensions.md - Added example with new options and option descriptionsdocs/sdk.md - Updated navigateTree signaturedocs/tree.md - Updated navigateTree signature, TreePreparation interface, and SessionBeforeTreeResult interface. Also fixed stale model field in SessionBeforeTreeEvent (removed, as the actual code doesn't pass model).Changelog entry - Added under ### Added with PR link and author attribution
rebase the branch on main
Done. Branch pr-787 is now rebased on main with my fixes on top:
107554ee Fix navigateTree API: add missing type updates, handler passthrough, and docs6b6707f3 Improve navigateTree API (original PR commit)ffdc8d68 docs: add OpenCode Zen to provider lists in coding-agent README (main)All checks pass. The branch is ready for review/merge.
holy shit that added coding-agent/binaries ... unfuck that
Fixed. Branch is clean now:
572ec64d Fix navigateTree API: add missing type updates, handler passthrough, and docs6b6707f3 Improve navigateTree APIffdc8d68 docs: add OpenCode Zen to provider lists... (main)11 files changed total (PR's 5 original files + my 6 additional fixes).
ok, looks good, merge into main
Done. PR #787 merged to main and pushed. Local branch cleaned up.
107554ee Fix navigateTree API: add missing type updates, handler passthrough, and docs6b6707f3 Improve navigateTree API (original PR commit)ffdc8d68 docs: add OpenCode Zen to provider lists in coding-agent README (main)572ec64d Fix navigateTree API: add missing type updates, handler passthrough, and docs6b6707f3 Improve navigateTree APIffdc8d68 docs: add OpenCode Zen to provider lists... (main)