Skip to content

Require JSON output for tools - #385

Closed
charleslien wants to merge 5071 commits into
mainfrom
charles/require-output
Closed

Require JSON output for tools#385
charleslien wants to merge 5071 commits into
mainfrom
charles/require-output

Conversation

@charleslien

Copy link
Copy Markdown
Contributor

No description provided.

jahooma and others added 30 commits November 17, 2025 17:36
- Fix indentation in feedback-store.ts
- Simplify symbol selection logic in feedback-icon-button.tsx
- Extract message context building helper in feedback-container.tsx
- Rename functions/variables for clarity in feedback-input-mode.tsx
- Simplify keyboard handler logic
- Add vertical scrollbar with minimal track width - Reorganize flex
direction properties for proper layout - Move flexDirection: 'column' to
inner content options
Implements hybrid approach: downloads binary on first run but stores in node_modules/codecane/bin/ instead of ~/.config/manicode. This ensures automatic cleanup on uninstall across all package managers (npm, pnpm, Bun) while keeping npm install minimal (5KB).
@charleslien

Copy link
Copy Markdown
Contributor Author

What needs to be done:

  1. Review the changes made in the "require json output for tool results" commit:
  • Namely, changed ToolResultOutput from (json | media) to {value: json, media?: media[]}
  1. Change all instances of ToolResultOutput[] to ToolResultOutput
  2. Fix all the resulting type errors

@charleslien

Copy link
Copy Markdown
Contributor Author

Note: perhaps the changing instances of ToolResultOutput[] to ToolResultOutput would be easier if you renamed the new one something different (like ToolResultContent)? then the typechecker would tell you where all the instances of ToolResultOutput are, since that variable no longer exists

@brandonkachen
brandonkachen force-pushed the main branch 2 times, most recently from 2c18ea5 to 08f4c5e Compare December 5, 2025 08:19
@codebuff-team

Copy link
Copy Markdown
Contributor

The core idea — moving from the old union ToolResultOutput ({type:'json',value} vs {type:'media',...}) to a single flattened shape ({value, media?}) and renaming $getToolCallString$getNativeToolCallExampleString to reflect native JSON tool calling instead of the <codebuff_tool_call> text convention — is a reasonable direction, and the mechanical rename across all common/src/tools/params/tool/*.ts description strings is done consistently.

However this PR bundles far too much into one changeset with an empty description:

  1. Unrelated agent logic rewrites: .agents/editor/best-of-n/editor-best-of-n.ts and .agents/file-explorer/file-picker.ts get substantial rewrites of extractSpawnResults/extractLastMessageText plumbing that have nothing to do with the stated title. These changes assume a new spawn-result shape (agentOutput.type === 'lastMessage') that isn't explained or justified anywhere in the diff.
  2. New integration tests that call live LLM APIs (editor-best-of-n.integration.test.ts, file-explorer.integration.test.ts) require a real CODEBUFF_API_KEY, run for 60-120s, and assert loosely on substring matches in freeform model output. These are flaky and expensive to run in CI, and one of the three is already .skip'd with a comment admitting the underlying feature doesn't fully work yet.
  3. cli/src/hooks/use-send-message.ts silently changes the condition for adding tool calls to subagent blocks from if (agentId) to if (parentAgentId && agentId) — a behavior change buried in a large diff with no explanation of why.
  4. Cost aggregation test assertions change (73→80, 50→60 credits) without justification for why the new native tool-call format changes credit costs — this looks like tests adjusted to match new behavior rather than verifying it's correct.

Given the private repo receives hand-ported changes, this diff is too large and unfocused to port safely — the tool-output-shape change, the agent-logic rewrite, and the CLI behavior change should be three separate PRs, each with a description explaining the reasoning and edge cases handled.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:needs-work Right idea, not mergeable as written labels Aug 19, 2026
@victorxheng
victorxheng force-pushed the charles/require-output branch from 3b59c87 to 58462e2 Compare August 31, 2026 21:01
@github-actions

Copy link
Copy Markdown
Contributor

PR checks failed

A couple of things need fixing before this can be reviewed.
None of them are about the code itself.

Description is empty or too short.

Please say what the change does and why. If it fixes an open
issue, link it (Fixes #123). Reviewers here port accepted
changes by hand into a private source tree, so a PR that does
not explain itself is expensive to accept and usually is not.


Edit the PR and this check re-runs automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:needs-work Right idea, not mergeable as written

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants