# Long runs across interfaces

All interfaces reach one Worker (`WorkerLock`), one session store and one event bus. Every action goes through the Worker; no interface keeps its own unsynchronized state.

| Need | Mechanism | Status |
| --- | --- | --- |
| Do not ask while unattended | Tool policy removes `ask_user_question` | Implemented |
| Change direction during a run | Steering delivered at loop checkpoints | Implemented |
| Answer questions anywhere | One question registry and wait store; each interface renders the event | Web and terminal |
| See a running session anywhere | Running state and open waits are sent on load | State and waits replayed; intermediate deltas are not |

## Attended mode

|  |  |
| --- | --- |
| Effect | `denied_ask_tools` folds `ask_user_question` into the policy deny, whichever toolset a function requests. Without the tool the agent cannot ask; uncertain output is left for later model reasoning. |
| Scope | Per session in Worker memory, with a process-wide default for callers with no session |
| Default | Unattended: a bare or background run has nobody watching |
| Web | Composer toggle |
| Terminal interface | `/attended [on\|off]`, `/unattended` |
| Sync | `set_attended` action; the Worker broadcasts `attended_changed` |

## Steering

`agent_loop` calls `get_steering_messages` at turn start, after a tool round and before follow-up. A new instruction takes effect at the next checkpoint; the current step finishes first. Interfaces send `execution.steer`, which saves the command first ([controls](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/execution/control.html#commands)).

## Questions

`QuestionRegistry` is process-wide, thread-safe and claim-once, with an event-layer and a queue transport plus a subprocess bridge. The answer returns to the same registry from any interface. Open waits are replayed when a session loads.

## Graceful stop

`cancel_event` runs end to end; subprocesses stop through `request_graceful_stop` in `process_runner.py`.

[Activity and control](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/execution/control.html)
