Repository navigation
fix(agents): stop lean workspace prompts referencing write_todos - #1704
aka-khannaji wants to merge 2 commits into
Conversation
Workspace roots drop write_todos from their toolset, but a lean compaction policy still appended guidance telling them to write a todo plan. Pass the workspace flag through and keep the plan in the transcript instead. Fixes CodebuffAI#1692.
|
Nice, surgical fix. The root cause is correctly identified: The fix threads an The added test in One minor nit: This is a small, correct, well-tested change in-scope for the mirror (agents/) and should be straightforward to port. |
The workspace and non-workspace plan/stay bullets duplicated most of their wording, so a future edit could drift one branch. Both now come from a single sentence skeleton with the root-specific parts as values. The CLI text is unchanged byte for byte.
|
Good catch on the duplication. Addressed in 40e3d0d: each bullet now has one skeleton ( The non-workspace text is unchanged byte for byte: both original CLI sentences still render verbatim from |
Fixes #1692.
Problem
createBase3({ workspace: true })removeswrite_todosfrom the tool list(
agents/base3.ts:203) and strips the todo guidance from the base prompt, butthe lean context-budget section was appended unconditionally:
So a Desktop/Cloud workspace root whose catalog row supplies a
leancompaction policy was told, in the same system prompt that withheld the tool:
The second line is also wrong for those roots: remaining todos only survive
condensing when the tool exists, so there is nothing to check.
Change
leanContextGuidancetakes an optional{ workspace }flag and swaps the twotodo-dependent bullets for workspace-safe wording when it is set:
has no to-do tool;
Non-workspace roots (every CLI root, and workspace roots without a lean policy)
keep the existing text byte-for-byte.
Verification
bun test agents/__tests__/base3.test.ts— 24 pass, including a newregression test for
{ lean, workspace: true }bun x tsc --noEmit -p agents/tsconfig.json— clean