Feature/fix project path - #11
Conversation
Claude Code agent: pass run_ctx in get_context for AskUserQuestion and tool confirmation; track tool_call_display_names and async-for claude_message_to_events with tool_names_by_id. Converters: merge external tool id→name map, per-block PartDeltaEvent indices, ThinkingPartDelta for thinking, resolve message_id from message. SkillsInstruction: full XML without leading indentation in instruction body. Agents: simplify history processor arity check (1 or 2). Storage: honor session_id in get_message (SQL/memory/file); ancestry walks parents without session filter for cross-session forks. ACP: import AvailableCommand at runtime. Tests: ThinkingPartDelta, indices, external tool name map regression. Made-with: Cursor
- Add command validation in bash tool to prevent dangerous commands - Add AST validation in Tool.from_code to restrict dangerous code execution - Add AST validation in debug tool introspection for safety - Improve subprocess execution with safer shell usage - Fix ClaudeCodeAgent callback run context for concurrency safety - Make Zed storage provider operations async - Improve error handling and logging in storage manager - Normalize skill name to lowercase kebab-case - Fix Windows desktop command execution
The agent_type parameter was not being used when creating SessionData, which meant child sessions would not have their agent type persisted. This fixes the review comment from PR wolf1069b#10.
- Add tool_inputs_by_id parameter to claude_message_to_events - Pass tool inputs from tool_use events to tool completion events - Track tool inputs in ClaudeCodeAgent using tool_call_inputs dict - Fix misleading comment about list result handling This addresses PR wolf1069b#10 review comments about tool_input being hard-coded as empty dict, ensuring tool call context is preserved for UI and logging.
There was a problem hiding this comment.
Code Review
This pull request introduces significant security and architectural improvements, including command validation for the Bash tool, an AST-based sandbox for dynamic code execution, and safer subprocess handling. It also enhances the Claude agent's concurrency safety, refactors storage providers for better session filtering, and migrates synchronous database calls to asynchronous ones in the Zed provider. Key feedback highlights a critical bug involving a non-existent import in the storage manager, a logic flaw in the sandbox that blocks method calls on literals, and several PEP 8 violations regarding inline imports. Additionally, it is recommended to adopt a whitelist approach for the debug tool's introspection security to ensure consistency with other sandboxed components.
- Fix chained_exception ImportError by using RuntimeError with manual __cause__ - Fix sandbox validation to allow literal method calls (e.g., 'hello'.upper()) - Move import statements to file level per PEP 8 - Replace blacklist with whitelist approach in debug.py sandbox for better security - Remove duplicate dictionary key in debug.py
|
/gimini review |
- Replace inspect.stack() with sys._getframe() in _should_bypass_session_pool() to avoid O(n) stack traversal overhead (Comment #8) - Add None guard for original_after_tool in hook_manager.py (Comment #9) - Fix fire-and-forget task GC issues by using TaskManager.fire_and_forget() in BaseAgent and adding _background_tasks set in TurnRunner (Comment #11)
解决上一版本合并丢失的问题