Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/kimi_cli/soul/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def restore(self) -> bool:
async for line in f:
if not line.strip():
continue
line_json = json.loads(line)
line_json = json.loads(line, strict=False)
if line_json["role"] == "_system_prompt":
self._system_prompt = line_json["content"]
continue
Expand Down Expand Up @@ -154,7 +154,7 @@ async def revert_to(self, checkpoint_id: int):
if not line.strip():
continue

line_json = json.loads(line)
line_json = json.loads(line, strict=False)
if line_json["role"] == "_checkpoint" and line_json["id"] == checkpoint_id:
break

Expand Down
4 changes: 3 additions & 1 deletion src/kimi_cli/soul/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def handle(self, tool_call: ToolCall) -> HandleResult:
tool = self._tool_dict[tool_call.function.name]

try:
arguments: JsonType = json.loads(tool_call.function.arguments or "{}")
arguments: JsonType = json.loads(
tool_call.function.arguments or "{}", strict=False
)
except json.JSONDecodeError as e:
return ToolResult(tool_call_id=tool_call.id, return_value=ToolParseError(str(e)))

Expand Down
2 changes: 1 addition & 1 deletion src/kimi_cli/ui/shell/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def _extract_full_url(arguments: str | None, tool_name: str) -> str | None:
if tool_name != "FetchURL" or not arguments:
return None
try:
args = json.loads(arguments)
args = json.loads(arguments, strict=False)
except (json.JSONDecodeError, TypeError):
return None
if isinstance(args, dict):
Expand Down