Project
cortex
Description
When --timeout is set (N > 0), the client loop polls elapsed time only between handled events on handle.event_rx. On timeout it sets interrupted, prints Timeout reached after {N} seconds, and breaks out of the loop.
The process then drop(handle) and session_task.await. The spawned session.run() task was not aborted, so the agent loop can continue, including outbound API requests. That matches logs where Timeout reached after 1 seconds is followed a few seconds later by 402 Payment Required / INSUFFICIENT_BALANCE — the 402 is billing (no token balance), but it illustrates that work did not stop at the timeout line.
Additionally, the printed message uses self.timeout (N), not measured elapsed time, and the first timeout check cannot run until after the first event is received; long startup intervals before the first event make “after 1 seconds” read as wall-clock misleading.
Error Message
Debug Logs
System Information
OS: Windows (reporter)
Example: cortex run --cwd D:/Projects/Bittensor/100platform/cortex --timeout 1 "Run cargo test"
Reporter also saw: API 402 INSUFFICIENT_BALANCE (account balance — separate from timeout semantics)
Screenshots
https://github.com/kiannidev/screens/blob/main/784a09dbd82af5b05c41d120ebfb323a.png
https://github.com/kiannidev/screens/blob/main/17166d14e8f22c1699a15bc8e8a19abd.png
Steps to Reproduce
- Run:
cortex run --timeout 1 "<prompt that eventually starts agent loop>" (from a state that reaches the API).
- Observe
Timeout reached after 1 seconds when the event loop decides elapsed > 1s (often on or after an event, not necessarily “1s from process start”).
- Observe further logs (e.g. API errors) after the timeout message while the process is still
await-ing session_task.
Expected Behavior
--timeout: Cancels or **abort()**s the session / agent task (or closes the session cleanly) so no further API calls run after timeout, or the UX clearly states “display/interactive timeout; background session may continue.”
- Error text: Prefer “Wall-clock limit: {N}s exceeded” (and optionally print elapsed) instead of implying exactly
N seconds since user-visible start.
Actual Behavior
- Loop breaks on timeout;
session_task.await waits for full session exit.
- API may still run; 402 can appear after “Timeout reached.”
- Message always says after {N} seconds even when wall time before first event was longer.
Additional Context
No response
Project
cortex
Description
When
--timeoutis set (N > 0), the client loop polls elapsed time only between handled events onhandle.event_rx. On timeout it setsinterrupted, printsTimeout reached after {N} seconds, and breaks out of the loop.The process then
drop(handle)andsession_task.await. The spawnedsession.run()task was not aborted, so the agent loop can continue, including outbound API requests. That matches logs whereTimeout reached after 1 secondsis followed a few seconds later by402 Payment Required/INSUFFICIENT_BALANCE— the 402 is billing (no token balance), but it illustrates that work did not stop at the timeout line.Additionally, the printed message uses
self.timeout(N), not measured elapsed time, and the first timeout check cannot run until after the first event is received; long startup intervals before the first event make “after 1 seconds” read as wall-clock misleading.Error Message
Debug Logs
System Information
OS: Windows (reporter) Example: cortex run --cwd D:/Projects/Bittensor/100platform/cortex --timeout 1 "Run cargo test" Reporter also saw: API 402 INSUFFICIENT_BALANCE (account balance — separate from timeout semantics)Screenshots
https://github.com/kiannidev/screens/blob/main/784a09dbd82af5b05c41d120ebfb323a.png
https://github.com/kiannidev/screens/blob/main/17166d14e8f22c1699a15bc8e8a19abd.png
Steps to Reproduce
cortex run --timeout 1 "<prompt that eventually starts agent loop>"(from a state that reaches the API).Timeout reached after 1 secondswhen the event loop decides elapsed > 1s (often on or after an event, not necessarily “1s from process start”).await-ingsession_task.Expected Behavior
--timeout: Cancels or **abort()**s the session / agent task (or closes the session cleanly) so no further API calls run after timeout, or the UX clearly states “display/interactive timeout; background session may continue.”Nseconds since user-visible start.Actual Behavior
session_task.awaitwaits for full session exit.Additional Context
No response