Repository navigation
Bound agent journal queue during startup - #37247
Conversation
900f2a6 to
58a3de7
Compare
|
No actionable comments were generated in the recent review.
|
Limit startup queue growth by bytes and operation count, while preserving backpressure and allowing final Pi events to drain after exit.
58a3de7 to
4790afd
Compare
Problem
If an agent produces output faster than it can be saved during startup, Orca can keep too much in memory and slow down or fail.
Solution
Limit queued startup output until Orca can pause the agent's reading. If the limit is exceeded, fail the session instead of allowing the queue to grow without bounds. Once reading control is available, continue using it to pace output.
ELI5
Orca now puts a safety limit on the pile of agent updates waiting to be saved, while still preserving final updates when a session ends.
What Changed
Why
Reading cannot be paused before control is bound, so the startup limit prevents unbounded memory growth. After control has bound, pacing can handle pressure without applying the startup limit to final writes.
Linked Issue
None.
Visual Proof
N/A — this changes queue handling and session cleanup without a visual or interaction change.
Testing
Added automated tests for the startup limits, queue draining, and final-message persistence. Test execution and platforms are not confirmed.
Risk
Level: Medium
An agent that exceeds the startup limit now fails its session, and incorrect queue accounting or cleanup could affect saved agent output. This affects agent sessions across platforms and remote use. A plain revert restores the previous behavior but does not recover output from a session that already failed.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Consider security, cross-platform support, remote SSH, mobile, backwards compatibility, and performance during review.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)