Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

fix: parse invoke/tool_call arguments in xml compatibility paths - #86

Merged
CJackHwang merged 1 commit into
codex/linear-mention-cja-10-ds2api-go-runtime-jsfrom
codex/fix
Mar 8, 2026
Merged

CJackHwang merged 1 commit into
codex/linear-mention-cja-10-ds2api-go-runtime-jsfrom
codex/fix

Conversation

@CJackHwang

Copy link
Copy Markdown
Owner

Motivation

  • XML/markup toolcall fixtures were losing argument payloads for <tool_call> and <invoke> styles because <arguments>/<input>/<argument> blocks were not being parsed into the tool input map.
  • This caused compatibility test fixtures (Go vs JS) to report empty input for cases that contained JSON or KV-style child tags.

Description

  • Update internal/util/toolcalls_parse_markup.go to collect argument payloads from XML child tags by decoding <input>, <arguments>, <argument>, <args>, and <params> and merging parsed JSON into the params map in parseSingleXMLToolCall.
  • Enhance parseInvokeFunctionCallStyle to fall back to extracting arguments via findMarkupTagValue + parseMarkupInput or parseMarkupKVObject when <parameter> entries are absent, so <invoke name="...">...</invoke> cases correctly populate input.
  • These changes restore parity with existing fixtures that embed JSON in argument/arguments tags and handle generic key-value child tags.

Testing

  • Ran ./tests/scripts/check-refactor-line-gate.sh which passed (no missing/over-limit files).
  • Ran ./tests/scripts/run-unit-all.sh which executed unit tests and the JS compat suite; all tests passed.
  • Ran go test ./internal/util ./internal/compat which passed and confirmed the toolcall fixtures are now correct.
  • Built the WebUI with npm ci --prefix webui and npm run build --prefix webui, which completed successfully.

Codex Task

@vercel

vercel Bot commented Mar 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Mar 8, 2026 5:16am

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@CJackHwang
CJackHwang merged commit 9240f85 into codex/linear-mention-cja-10-ds2api-go-runtime-js Mar 8, 2026
3 checks passed
@CJackHwang
CJackHwang deleted the codex/fix branch March 8, 2026 05:17

This branch was successfully deployed

1 active deployment
Preview — ea4bd1e4 Deployed Mar 8, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant