mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-13 02:35:04 +00:00
* 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.
|
||
|---|---|---|
| .. | ||
| compression.go | ||
| compression_test.go | ||
| init_test.go | ||
| loop.go | ||
| loop_test.go | ||
| pool.go | ||
| pool_test.go | ||
| runner_test.go | ||