From 479f37ac7563dd7f07c35fd70c12b75e427f88db Mon Sep 17 00:00:00 2001 From: justinmadison Date: Fri, 7 Nov 2025 08:26:45 -0800 Subject: [PATCH 1/2] Format Python code with black MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Run black on python/ directory to fix formatting issues - Reformatted 4 files: agent.py, tool_dispatcher.py, base.py, llama_cpp_backend.py - All tests still pass after formatting This fixes the black format check failures in GitHub CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- python/agent_runtime/agent.py | 9 +++++---- python/agent_runtime/tool_dispatcher.py | 15 +++++++++------ python/backends/base.py | 2 ++ python/backends/llama_cpp_backend.py | 4 +++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/python/agent_runtime/agent.py b/python/agent_runtime/agent.py index 316601e..55a3ff4 100644 --- a/python/agent_runtime/agent.py +++ b/python/agent_runtime/agent.py @@ -13,6 +13,7 @@ @dataclass class Observation: """Represents an agent's observation of the world.""" + timestamp: datetime data: Dict[str, Any] source: str = "world" @@ -21,6 +22,7 @@ class Observation: @dataclass class Action: """Represents an action the agent wants to take.""" + tool_name: str parameters: Dict[str, Any] reasoning: Optional[str] = None @@ -29,6 +31,7 @@ class Action: @dataclass class AgentState: """Internal state of an agent.""" + agent_id: str goals: List[str] = field(default_factory=list) observations: List[Observation] = field(default_factory=list) @@ -87,7 +90,7 @@ def perceive(self, observation: Dict[str, Any], source: str = "world") -> None: # Keep only recent observations to manage memory if len(self.state.observations) > self.memory_capacity: - self.state.observations = self.state.observations[-self.memory_capacity:] + self.state.observations = self.state.observations[-self.memory_capacity :] logger.debug(f"Agent {self.state.agent_id} received observation from {source}") @@ -113,9 +116,7 @@ def decide_action(self) -> Optional[Action]: if action: self.state.action_history.append(action) - logger.info( - f"Agent {self.state.agent_id} decided action: {action.tool_name}" - ) + logger.info(f"Agent {self.state.agent_id} decided action: {action.tool_name}") return action diff --git a/python/agent_runtime/tool_dispatcher.py b/python/agent_runtime/tool_dispatcher.py index 7cb32bd..a3788c9 100644 --- a/python/agent_runtime/tool_dispatcher.py +++ b/python/agent_runtime/tool_dispatcher.py @@ -13,6 +13,7 @@ @dataclass class ToolSchema: """Schema definition for a tool.""" + name: str description: str parameters: Dict[str, Any] # JSON schema for parameters @@ -154,11 +155,13 @@ def export_schemas_json(self) -> str: """ schemas = [] for schema in self.schemas.values(): - schemas.append({ - "name": schema.name, - "description": schema.description, - "parameters": schema.parameters, - "returns": schema.returns, - }) + schemas.append( + { + "name": schema.name, + "description": schema.description, + "parameters": schema.parameters, + "returns": schema.returns, + } + ) return json.dumps(schemas, indent=2) diff --git a/python/backends/base.py b/python/backends/base.py index 2fa6256..d2b3622 100644 --- a/python/backends/base.py +++ b/python/backends/base.py @@ -10,6 +10,7 @@ @dataclass class BackendConfig: """Configuration for LLM backend.""" + model_path: str temperature: float = 0.7 max_tokens: int = 512 @@ -20,6 +21,7 @@ class BackendConfig: @dataclass class GenerationResult: """Result from LLM generation.""" + text: str tokens_used: int finish_reason: str # "stop", "length", "error" diff --git a/python/backends/llama_cpp_backend.py b/python/backends/llama_cpp_backend.py index e4e5a02..3cf3b47 100644 --- a/python/backends/llama_cpp_backend.py +++ b/python/backends/llama_cpp_backend.py @@ -37,7 +37,9 @@ def _load_model(self) -> None: logger.info("Model loaded successfully") except ImportError: - logger.error("llama-cpp-python not installed. Install with: pip install llama-cpp-python") + logger.error( + "llama-cpp-python not installed. Install with: pip install llama-cpp-python" + ) raise except Exception as e: logger.error(f"Failed to load model: {e}") From 60c383dd6461370f7d86c8419b58f7d0ec7457f2 Mon Sep 17 00:00:00 2001 From: justinmadison Date: Fri, 7 Nov 2025 08:30:41 -0800 Subject: [PATCH 2/2] Remove .claude/settings.local.json from version control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is already in .gitignore and should not be tracked as it contains user-specific local settings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/settings.local.json | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 51913d2..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(tree:*)", - "Bash(find:*)", - "Bash(.gitignore)", - "Bash(mkdir:*)", - "Bash(git clone:*)", - "Bash(cmake:*)", - "Bash(where:*)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin\\cmake.exe\" ..)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin\\cmake.exe\" --build . --config Debug)", - "Bash(git fetch:*)", - "Bash(git describe:*)", - "Bash(git checkout:*)", - "Bash(dir:*)", - "Bash(python -m pytest:*)", - "Bash(python -m venv:*)", - "Bash(python -m pip install:*)", - "Bash(git add:*)", - "Bash(git commit:*)", - "Bash(git push:*)", - "Bash(gh pr create:*)" - ], - "deny": [], - "ask": [] - } -}