fix: rename _registry to _tool_registry to avoid shadowing Textual internal
The App base class uses _registry (WeakSet) for DOM node tracking. Our _registry attribute for the tool registry was shadowing it with None, causing a TypeError during shutdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class SneakyCodeApp(App):
|
|||||||
self._ctx: SessionContext | None = None
|
self._ctx: SessionContext | None = None
|
||||||
self._agent: AgentLoop | None = None
|
self._agent: AgentLoop | None = None
|
||||||
self._client: LLMClient | None = None
|
self._client: LLMClient | None = None
|
||||||
self._registry = None
|
self._tool_registry = None
|
||||||
self._permissions: PermissionsService | None = None
|
self._permissions: PermissionsService | None = None
|
||||||
self._current_worker: Worker | None = None
|
self._current_worker: Worker | None = None
|
||||||
self._cancel_count = 0
|
self._cancel_count = 0
|
||||||
@@ -69,7 +69,7 @@ class SneakyCodeApp(App):
|
|||||||
# Create long-lived agent dependencies (reused across turns)
|
# Create long-lived agent dependencies (reused across turns)
|
||||||
self._client = LLMClient(self._config.llm)
|
self._client = LLMClient(self._config.llm)
|
||||||
await self._client.__aenter__()
|
await self._client.__aenter__()
|
||||||
self._registry = create_default_registry(self._config.agent.workspace_root, self._config)
|
self._tool_registry = create_default_registry(self._config.agent.workspace_root, self._config)
|
||||||
self._permissions = PermissionsService(self._config.permissions)
|
self._permissions = PermissionsService(self._config.permissions)
|
||||||
|
|
||||||
# Set up permission prompt callback
|
# Set up permission prompt callback
|
||||||
@@ -178,7 +178,7 @@ class SneakyCodeApp(App):
|
|||||||
|
|
||||||
agent = AgentLoop(
|
agent = AgentLoop(
|
||||||
self._config, self._ctx, self._client, handler,
|
self._config, self._ctx, self._client, handler,
|
||||||
self._registry, self._permissions, display,
|
self._tool_registry, self._permissions, display,
|
||||||
)
|
)
|
||||||
|
|
||||||
await agent.run_turn(user_input)
|
await agent.run_turn(user_input)
|
||||||
|
|||||||
Reference in New Issue
Block a user