mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-04 14:01:45 +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.
|
||
|---|---|---|
| .. | ||
| agent | ||
| config | ||
| delegate | ||
| diff | ||
| gitcmd | ||
| llm | ||
| llmloop | ||
| mcp | ||
| model | ||
| pathutil | ||
| release | ||
| scan | ||
| session | ||
| stdout | ||
| suggestdiff | ||
| telemetry | ||
| tool | ||
| viewer | ||