Skip to content

Merge pull request #104 from CJackHwang/codex/revert-to-commit-efb484b Restore tool-call parsing and repair logic; remove accidental split files#105

Merged
CJackHwang merged 14 commits intodevfrom
codex/fix-issues-found-in-review
Mar 19, 2026
Merged

Merge pull request #104 from CJackHwang/codex/revert-to-commit-efb484b Restore tool-call parsing and repair logic; remove accidental split files#105
CJackHwang merged 14 commits intodevfrom
codex/fix-issues-found-in-review

Conversation

@CJackHwang
Copy link
Owner

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

优化 激进模式

📝 补充信息 | Additional Information

@vercel
Copy link

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment Mar 19, 2026 6:37pm

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e49d9d33e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +271 to +273
if err := json.Unmarshal([]byte(raw), &parsed); err == nil && parsed != nil {
return parsed
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Re-run path-safe repair after successful JSON unmarshal

In parseToolCallInput, string arguments return immediately on the first successful json.Unmarshal. That allows payloads such as {"path":"D:\tmp\a.txt"} to pass with \t/\n/\r decoded into control characters, silently corrupting Windows-style paths before tool execution. This is a regression from the prior path-context safeguard and can make file/tool operations target the wrong path while still looking like a successful parse.

Useful? React with 👍 / 👎.

// E.g., "key": {"a": 1}, {"b": 2} -> "key": [{"a": 1}, {"b": 2}]
// NOTE: The pattern uses (?:[^{}]|\{[^{}]*\})* to support single-level nested {} objects,
// which handles cases like {"content": "x", "input": {"q": "y"}}
var missingArrayBracketsPattern = regexp.MustCompile(`(:\s*)(\{(?:[^{}]|\{[^{}]*\})*\}(?:\s*,\s*\{(?:[^{}]|\{[^{}]*\})*\})+)`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore deep-nesting bracket repair for loose JSON object lists

The missing-array repair now relies solely on missingArrayBracketsPattern, which only supports one nested object level. Deeply nested hallucinated lists (for example items containing {"meta":{"a":{"b":1}}}) are no longer repaired into arrays, so downstream parsing drops otherwise recoverable tool calls. The previous scanner-based path handled deeper nesting, so this change regresses robustness on realistic malformed model outputs.

Useful? React with 👍 / 👎.

@CJackHwang CJackHwang merged commit b1f8d61 into dev Mar 19, 2026
3 checks passed
@CJackHwang CJackHwang deleted the codex/fix-issues-found-in-review branch March 19, 2026 18:38
CJackHwang added a commit that referenced this pull request Mar 19, 2026
Merge pull request #105 from CJackHwang/codex/fix-issues-found-in-review

Merge pull request #104 from CJackHwang/codex/revert-to-commit-efb484b

Restore tool-call parsing and repair logic; remove accidental split files
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.

1 participant