(
self, task_id: str, registry: "RuntimeTaskRegistry"
)
| 111 | type: Literal["local_bash"] = "local_bash" |
| 112 | |
| 113 | async def kill( |
| 114 | self, task_id: str, registry: "RuntimeTaskRegistry" |
| 115 | ) -> None: |
| 116 | state = registry.get(task_id) |
| 117 | if not is_local_shell_task(state): |
| 118 | return |
| 119 | assert isinstance(state, LocalShellTaskState) # narrow for mypy |
| 120 | proc = state.proc |
| 121 | if proc is None: |
| 122 | return |
| 123 | if proc.poll() is not None: |
| 124 | return |
| 125 | try: |
| 126 | os.killpg(os.getpgid(proc.pid), 15) |
| 127 | except (ProcessLookupError, PermissionError): |
| 128 | return |
| 129 | |
| 130 | |
| 131 | # Per Chunk-C N1 fold-in: registration moved to |
no test coverage detected