Retarget persistent runtime to Codex app-server#91
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ba5dd39. Configure here.
| } | ||
| } | ||
| section | ||
| }; |
There was a problem hiding this comment.
Persistent backlog section missing overflow and guard notices
Medium Severity
The persistent loop's backlog_section is missing two pieces of logic present in the one-shot version: the overflow notice when total_matching > tasks.len() ("...and X more role-matching backlog task(s)") and the guard message when total_backlog > 0 but no tasks match the role ("No backlog tasks currently match your role hint. Do not claim unrelated work by default."). Without the guard message, persistent-mode agents may claim unrelated backlog tasks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ba5dd39. Configure here.
| 5. Use `supervisor` / `conductor` when you need human guidance, priority changes, broader sequencing, escalation, or town-wide visibility. | ||
| 6. If blocked, send a query with specific unblock needs. | ||
| 7. Use `tt task current` to confirm the real Tinytown task id before completing work. | ||
| 8. When finished with a task, mark it complete: `tt task complete <task_id> --result \"what was done\"` |
There was a problem hiding this comment.
Raw string literal contains spurious backslash-escaped quotes
Low Severity
Line 878 uses \"what was done\" inside a r#"..."# raw string literal. In raw strings, backslashes are not escape characters, so the output contains literal \" characters. The one-shot prompt correctly uses unescaped "what was done". The persistent agent sees garbled instructions with stray backslashes.
Reviewed by Cursor Bugbot for commit ba5dd39. Configure here.


Summary
tt agent-loopruntime tocodex app-serverinstead of the earlier Claude-first streaming adaptercodex,codex-mini) and fall unsupported CLIs back to the existing one-shot loopTesting
cargo test --no-runtarget/debug/deps/integration_tests-9ee69f1b1d41bbad test_agent_loop_persistent_runtime_ --nocapturecargo test --test integration_tests test_agent_persistent_config_parse -- --nocapturecargo test --test integration_tests test_persistent_agent_loop_exits_cleanly_after_idle_timeout -- --nocaptureCloses #83.
Note
Medium Risk
Introduces a new persistent subprocess execution path for
tt agent-loop(including interruption/restart behavior) and stores new state in Redis, which could affect worker reliability and message handling if edge cases are missed.Overview
Adds an opt-in persistent streaming runtime for
tt agent-loop([agent].persistent = true) that keeps a long-lived coding CLI session across turns (currently implemented forcodex/codex-miniviacodex app-server), while preserving the existing one-shot subprocess-per-turn default.Agent state now persists a
runtime_session_idin Redis to resume streaming sessions after restarts, and the persistent loop is driven by structured runtime events (turn started/completed, tool calls, deltas, awaiting input, runtime errors) which are also emitted onto the per-agent Redis event stream. Documentation is updated to describe the runtime model, and integration tests add coverage for persistent reuse, urgent mid-turn injection, stop interruption, idle-timeout behavior, and event emission.Reviewed by Cursor Bugbot for commit ba5dd39. Bugbot is set up for automated code reviews on this repo. Configure here.