Seed a minimal ``LocalShellTaskState`` on ``runtime_tasks``. Used by the shell_id back-compat tests; mirrors what ``spawn_background_bash`` populates, minus the live Popen handle (so ``stop_background_bash`` returns False — which is exactly the routing-only behavior the test wants to
(ctx: ToolContext, task_id: str)
| 104 | |
| 105 | |
| 106 | def _seed_bash_state(ctx: ToolContext, task_id: str) -> None: |
| 107 | """Seed a minimal ``LocalShellTaskState`` on ``runtime_tasks``. Used |
| 108 | by the shell_id back-compat tests; mirrors what ``spawn_background_bash`` |
| 109 | populates, minus the live Popen handle (so ``stop_background_bash`` |
| 110 | returns False — which is exactly the routing-only behavior the |
| 111 | test wants to verify).""" |
| 112 | from src.tasks.local_shell import LocalShellTaskState |
| 113 | |
| 114 | state = LocalShellTaskState( |
| 115 | id=task_id, |
| 116 | type="local_bash", |
| 117 | status="running", |
| 118 | description="seeded test entry", |
| 119 | start_time=0.0, |
| 120 | output_file="/tmp/x", |
| 121 | command="sleep 30", |
| 122 | cwd="/tmp", |
| 123 | ) |
| 124 | ctx.runtime_tasks.upsert(state) |
| 125 | |
| 126 | |
| 127 | def test_shell_id_resolves_to_known_bash_task(ctx: ToolContext) -> None: |
no test coverage detected