Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3436. One of five independent stale-code PRs off
dev. Docs only — 39 lines added, 3 removed, four files underdocs/memory/.What
The issue asked for agent loops to cost nothing on an instance with no loops. The diagnosis found the cost is already negligible, and the operator ruled no code change (comment on the issue, 2026-10-09). This PR records what was found, so the next reader does not have to rediscover it.
architecture/background-services.md— a row for the loop due-run sweep, which was missing: started frommain.py, first tick after 8–10 s, then every 5–6 s, in every backend worker with no leader lease (claim_due_loopdecides which worker dispatches). With nothing parked it is one index seek onidx_loops_next_runreturning no rows. The startup loop hook is renamed to what it does since feat(pull): make loops terminal-driven so they can run on the durable queue #2523: it re-arms or advances, and interrupts nothing.requirements/scheduling.md— §38.8, the restart-recovery behaviour from feat(pull): make loops terminal-driven so they can run on the durable queue #2523, which had no requirements entry; §38.9, the idle cost and why the sweep is deliberately not gated. §38.1's older restart bullet is marked superseded.architecture/execution.md— the sequential-loops paragraph described the pre-feat(pull): make loops terminal-driven so they can run on the durable queue #2523 in-process runner. It now describes the terminal-driven design: the row is the loop, stop stampsstop_requested_at, and the counter and fingerprint are rebuilt from the loop's run rows on every advance.feature-flows/run-agent-loop.md— who reads the loop tables without being asked: the sweep, the boot reconcile, and the per-terminalget_loop_run_by_executionlookup, which cannot be gated because a loop run's terminal can land on a worker that never touched the loop.Ruling carried (operator, recorded on the issue)
Review
/review(reading review, report-only): MERGEABLE. All 14 factual statements the diff adds were checked against the code on the branch tip, each with a quoted line, and are true. One is scoped rather than universal: "index seek" holds for SQLite; PostgreSQL may scan a table this small. Fixed after review: four stale sentences in the touched paragraphs. Docs only, so the security pass is a paragraph: nothing sensitive in the added lines.Tests
test_2306,test_2338,test_2070,test_2339,test_2350): 147 passed.git merge-treeagainstdev(21b4a11): clean. No conflict with the other four PRs of this set or with open PRs sharing these files (feat(skills): one Skills tab — own and shared skills, Run, Requires approval (abilityai/trinity-enterprise#754) #3412, fix(auth): an agent key reaches only itself, its edges and the agents it spawned — on the raw backend routes too (trinity-enterprise#629) #3346, feat(workspace): a stage advance reaches the Work card on the write, not the next poll (ent#533) #2713).Before merge
Nothing beyond review.
Handoffs (from the plan, not filed)
agent_loops/agent_loop_runshave no retention prune (only the cascade on agent delete) — the boot reconcile is a table scan that grows forever; same class as refactor(retention): product_events grows without bound — prune_product_events() has zero callers; wire the standard retention sweep #2442.schedule_executions.loop_idthroughspawn_task_terminal_event(16 call sites) — saves one ~4 µs read per non-loop terminal.🤖 Generated with Claude Code