From 334ef09858e5b2a6173d42ae53007db7f623d19b Mon Sep 17 00:00:00 2001 From: konard Date: Mon, 27 Jul 2026 03:36:32 +0000 Subject: [PATCH 1/2] Initial commit with task details Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: https://github.com/link-assistant/agent/issues/281 --- .gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 0000000..94e2378 --- /dev/null +++ b/.gitkeep @@ -0,0 +1 @@ +# .gitkeep file auto-generated at 2026-07-27T03:36:32.513Z for PR creation at branch issue-281-8d4563b818c2 for issue https://github.com/link-assistant/agent/issues/281 \ No newline at end of file From ee6386450aa5d94a95afe5ddd2c1a0b5c4c37a70 Mon Sep 17 00:00:00 2001 From: konard Date: Mon, 27 Jul 2026 03:40:56 +0000 Subject: [PATCH 2/2] Fix stream-json tool use details --- js/.changeset/fix-stream-json-tool-use.md | 5 +++++ js/src/json-standard/index.ts | 5 ++--- js/tests/json-standard-unit.js | 17 +++++++++++------ 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 js/.changeset/fix-stream-json-tool-use.md diff --git a/js/.changeset/fix-stream-json-tool-use.md b/js/.changeset/fix-stream-json-tool-use.md new file mode 100644 index 0000000..c26cb3c --- /dev/null +++ b/js/.changeset/fix-stream-json-tool-use.md @@ -0,0 +1,5 @@ +--- +'@link-assistant/agent': patch +--- + +Report tool names and inputs correctly in `stream-json` tool-use events. diff --git a/js/src/json-standard/index.ts b/js/src/json-standard/index.ts index a1e6190..f8bf82c 100644 --- a/js/src/json-standard/index.ts +++ b/js/src/json-standard/index.ts @@ -111,13 +111,12 @@ export function convertOpenCodeToClaude( case 'tool_use': if (event.part && event.part.state) { const state = event.part.state as Record; - const tool = state.tool as Record | undefined; return { type: 'tool_use', timestamp, session_id, - name: (tool?.name as string) || 'unknown', - input: tool?.parameters || {}, + name: (event.part.tool as string) || 'unknown', + input: state.input || {}, tool_use_id: event.part.id as string, }; } diff --git a/js/tests/json-standard-unit.js b/js/tests/json-standard-unit.js index ac4b517..66cf863 100644 --- a/js/tests/json-standard-unit.js +++ b/js/tests/json-standard-unit.js @@ -121,11 +121,13 @@ describe('JSON Standard Module - Unit Tests', () => { sessionID: 'ses_test123', part: { id: 'prt_tool123', + type: 'tool', + callID: 'call_tool123', + tool: 'write', state: { - tool: { - name: 'bash', - parameters: { command: 'ls' }, - }, + status: 'pending', + input: { filePath: 'hi.txt', content: 'hi\n' }, + raw: '', }, }, }; @@ -134,8 +136,11 @@ describe('JSON Standard Module - Unit Tests', () => { expect(claudeEvent).not.toBeNull(); expect(claudeEvent.type).toBe('tool_use'); - expect(claudeEvent.name).toBe('bash'); - expect(claudeEvent.input).toEqual({ command: 'ls' }); + expect(claudeEvent.name).toBe('write'); + expect(claudeEvent.input).toEqual({ + filePath: 'hi.txt', + content: 'hi\n', + }); expect(claudeEvent.tool_use_id).toBe('prt_tool123'); });