Skip to content

Fix stream-json tool use details - #282

Merged
konard merged 2 commits into
mainfrom
issue-281-8d4563b818c2
Jul 27, 2026
Merged

Fix stream-json tool use details#282
konard merged 2 commits into
mainfrom
issue-281-8d4563b818c2

Conversation

@konard

@konard konard commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #281

Summary

  • Read tool names from the runtime tool part's tool field.
  • Read tool arguments from the tool state's input field.
  • Replace the obsolete synthetic unit fixture with a schema-accurate write tool event.
  • Add a patch changeset for the JavaScript package.

Reproduction and coverage

The regression fixture mirrors the real MessageV2.ToolPart emitted for a streamed tool call:

{
  type: 'tool',
  tool: 'write',
  state: {
    status: 'pending',
    input: { filePath: 'hi.txt', content: 'hi\n' },
  },
}

Before the fix, the converter produced name: "unknown" and input: {} because it looked for the obsolete state.tool.name and state.tool.parameters fields. The updated test asserts the emitted event contains name: "write" and the original input.

Verification

cd js
bun test ./tests/json-standard-unit.js
npm run check
npm test

Observed locally: focused converter tests passed (18/18), repository checks passed, and the full JavaScript suite passed with 609 pass / 4 todo / 0 fail.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #281
@konard konard self-assigned this Jul 27, 2026
@konard konard changed the title [WIP] stream-json reports every tool as "name": "unknown" with empty input Fix stream-json tool use details Jul 27, 2026
@konard
konard marked this pull request as ready for review July 27, 2026 03:41
@konard

konard commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented and finalized the fix in PR #282.

  • Corrected stream-json tool names and inputs using the actual runtime schema.
  • Added a reproducing regression test.
  • Added a JavaScript patch changeset.
  • Local suite: 609 passed, 4 existing todos, 0 failed.
  • Lint, formatting, and file-size checks passed.
  • CI passed on Ubuntu, macOS, and Windows.
  • PR is ready for review and cleanly mergeable.
  • Commit: ee63864 (Fix stream-json tool use details)

This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $3.858589

📊 Context and tokens usage:

  • 110.8K / 200K (55%) input tokens, 6.8K / 128K (5%) output tokens

Total: (110.8K + 2.4M cached) input tokens, 6.8K output tokens, $3.858589 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: low (~7999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (1223KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit 2d984e7 into main Jul 27, 2026
9 checks passed
@konard

konard commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

stream-json reports every tool as "name": "unknown" with empty input

1 participant