fix: resolve pyright type errors

- Fix launch.py provision callable signature to accept Bottle not str
- Rename _prompt_path to prompt_path to make it public (not protected)
- Fix PromptMode type handling in bottle.py files
- Update WorkspaceSpec protocol to use read-only properties for compatibility with frozen BottleSpec
- Fix pty_resize signal handler type annotation
- Update local_registry.py contextmanager return type to Generator (not Iterator)

These changes fix ~130 pyright errors related to type safety.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 23:25:41 -04:00
parent 58169e2ce9
commit 0bf1532557
7 changed files with 20 additions and 13 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ class DockerBottle(Bottle):
):
self.name = container
self._teardown = teardown
self._prompt_path = prompt_path_in_container
self.prompt_path = prompt_path_in_container
self._agent_prompt_mode = agent_prompt_mode
self.agent_command = agent_command
self.agent_provider_template = (
@@ -36,7 +36,7 @@ class DockerBottle(Bottle):
) -> list[str]:
full_argv = list(argv)
full_argv.extend(
prompt_args(self._agent_prompt_mode, self._prompt_path, argv=full_argv)
prompt_args(self._agent_prompt_mode, self.prompt_path, argv=full_argv)
)
cmd = ["docker", "exec"]
if tty:
+2 -2
View File
@@ -80,7 +80,7 @@ _REPO_DIR = str(Path(__file__).resolve().parent.parent.parent.parent)
def launch(
plan: DockerBottlePlan,
*,
provision: Callable[[DockerBottlePlan, str], str | None],
provision: Callable[[DockerBottlePlan, "DockerBottle"], str | None],
) -> Generator[DockerBottle, None, None]:
"""Build, launch, and provision a Docker bottle via compose.
Teardown on exit."""
@@ -218,7 +218,7 @@ def launch(
agent_command=plan.agent_command,
agent_prompt_mode=plan.agent_prompt_mode,
)
bottle._prompt_path = provision(plan, bottle)
bottle.prompt_path = provision(plan, bottle)
# Step 9: yield. exec_agent continues to use `docker exec -it`
# — the agent runs `sleep infinity` per the renderer's