open-code-review/internal
chethanuk efac9ecc06
fix(llmloop): guard nil tool-call arguments map to prevent panic (#393)
* fix(llmloop): guard nil tool-call arguments map to prevent panic

Some OpenAI-compatible gateways emit "arguments": null for tool calls.
json.Unmarshal("null", &args) succeeds and sets the map to nil (JSON
null nils maps regardless of prior value), so the code_comment path
override (args["path"] = newPath) panicked with "assignment to entry
in nil map", killing the per-file subtask.

- internal/llmloop: parse arguments through a shared parseToolArgs
  helper that always returns a non-nil map, covering both the known-tool
  and dynamic-tool paths.
- internal/llm: the Anthropic history-replay path had the same hazard --
  null arguments reset the pre-initialized argsMap to nil, serializing
  tool_use input as JSON null, which the API rejects.

Fixes #382

* docs(llm): trim nil-args comment and cross-reference parseToolArgs

Review feedback on #393: the two null-arguments guards now reference
each other instead of sharing a helper; a 2-line guard does not justify
a cross-package export.
2026-07-21 13:24:50 +08:00
..
agent feat(review): add resumable sessions and session inspection (#306) 2026-07-09 11:43:11 +08:00
config feat: add pot code review rules (#406) 2026-07-20 16:09:08 +08:00
delegate feat(delegate): add delegation mode for host-agent driven code review (#383) 2026-07-16 13:10:54 +08:00
diff fix(diff): add --end-of-options guard and no-commit regression test for workspace diff (#376) 2026-07-17 20:29:51 +08:00
gitcmd test: expand unit test coverage for agent, llm, llmloop, and tool packages 2026-06-26 23:09:11 +08:00
llm fix(llmloop): guard nil tool-call arguments map to prevent panic (#393) 2026-07-21 13:24:50 +08:00
llmloop fix(llmloop): guard nil tool-call arguments map to prevent panic (#393) 2026-07-21 13:24:50 +08:00
mcp test: fix golangci-lint errcheck/staticcheck issues in test code (#323) 2026-07-08 22:46:18 +08:00
model test: fix golangci-lint errcheck/staticcheck issues in test code (#323) 2026-07-08 22:46:18 +08:00
pathutil test: fix golangci-lint errcheck/staticcheck issues in test code (#323) 2026-07-08 22:46:18 +08:00
release fix(build): improve Windows support based on PR #13 review feedback 2026-06-02 22:37:27 +08:00
scan fix(scan): check user include patterns before the extension allowlist (#378) 2026-07-17 16:38:21 +08:00
session feat(review): add resumable sessions and session inspection (#306) 2026-07-09 11:43:11 +08:00
stdout test: add unit tests for output_helpers, config, model, stdout, and telemetry packages 2026-06-26 23:26:49 +08:00
suggestdiff test: add unit tests for pure logic functions across 6 packages 2026-06-26 22:41:35 +08:00
telemetry feat(telemetry): propagate W3C traceparent from parent process (#352) 2026-07-14 11:28:09 +08:00
tool fix(tool): reject traversal pathspecs in code_search (#303) 2026-07-09 13:45:24 +08:00
viewer fix: remove redundant font-family from .response-text .inline-code (#339) 2026-07-14 10:20:19 +08:00