Repository navigation
Keep long runs' activity timeline within the 200-step limit - #649
Conversation
The timeline projector had no step cap, but every reader (chat storage, Aiden Remote, iOS, Android, the OpenAPI schema) rejects a timeline with more than 200 steps. A run past that, about 100 tool calls with a thinking model, was saved with no timeline at all, losing its activity trail, question recaps, verification check and step-placed images, and phones stopped getting progress at step 200. The projector still records every step, but what it publishes is now bounded: older finished thinking stretches merge into one whose reasoning span covers theirs, then the oldest settled tool steps drop, read-only calls first and failed calls last. Running steps and the newest 40 are never folded, and public call ids are unchanged. No protocol revision: phones already accept up to 200 steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6RJCS8ZrZhCj6xAxhhS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6RJCS8ZrZhCj6xAxhhS
Review follow-up. Drops no longer move reply text or an image row's first step, thoughts merge only with a neighbour at the same offset so they stay where they happened, subagent and recording steps never fold, and the projector remembers what it folded so a step that settles later cannot bring an earlier one back. The newest 40 steps fold only when nothing older can. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6RJCS8ZrZhCj6xAxhhS
Second review follow-up. When the careful passes cannot make room (a run that writes a line before each call puts every call at its own offset), later passes drop regardless, so the reply keeps a timeline with its text joined rather than losing the timeline. Finished thoughts that sit side by side now join whenever room is needed, and a merged thought that reopens keeps an open reasoning span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6RJCS8ZrZhCj6xAxhhS
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes across the projector, shared timeline folding, long-run regression tests, documentation, and downstream desktop/remote/native consumers.
- Bounded snapshots: Keep the projector's complete internal history while publishing timelines within the existing 200-step reader limit.
- Stable folding: Persist removal and thinking-merge decisions, preserve public call IDs, and renumber retained steps without disrupting internal reconciliation indexes.
- Prioritized retention: Prefer routine settled calls for removal, preserve text boundaries and anchored activity rows where possible, and use documented relaxed fallback passes when necessary.
- Behavioral coverage and docs: Exercise long reasoning/tool runs, sticky folding, visual-row stability, and narrated runs; document retention rules and summary-count tradeoffs.
- Validation: All 177 focused desktop tests passed. Inspected both native validators and chronological projections. Android tests and an offline retry each timed out after 120000 ms; iOS tests could not run because
xcodebuildis unavailable. Hosted CI was still pending when checked, so this review does not establish full CI or native acceptance.
gpt-6.1-sol | 𝕏
|
CI on f716caf failed in the Linux Electron e2e job, and the two Linux packaging jobs (x64, arm64) failed after it. All 242 tests passed and 1 was flaky. The job fails on any flaky test:
This spec is already on the known-flaky list from #583 (run 39813515653, the Weekly total iframe timing out after relaunch). This PR's fold runs only past 200 steps; under that it returns the steps unchanged, and that spec's run is a few steps long. I re-ran the failed jobs once. If it fails again, I'll treat it as real and dig in. Generated by Claude Code |
Hermes Review BotConfidence: 4 Engine: SummaryThe projector now publishes a bounded view of the timeline: Confidence Score: 4/5I traced the projector through 📁 Important Files Changed
FindingsNo findings. 📊 Sequence DiagramsequenceDiagram
participant P as GenerationTimelineProjector
participant B as boundGenerationTimelineSteps
participant S as chat-store appendMessage
participant R as run-event-projection
P->>B: snapshot() copies internal steps + sticky folds
B->>B: drop/merge oldest ranks until <= 200, remember folds
B-->>P: bounded, order-renumbered steps
P->>S: finish() timeline on assistant save
S->>S: parseGenerationTimeline(steps <= 200)
P->>R: chat:timeline event
R->>R: parseGenerationTimeline(payload.timeline)
Machine-Readable Findings[]
|

Requested by sbt · project thread
Why
Every timeline reader accepts at most 200 steps:
parseGenerationTimeline, iOS, Android, and the OpenAPImaxItems. ButGenerationTimelineProjectorhad no cap. A run longer than that (about 100 tool calls with a thinking model) lost its timeline in two places:chat-store-coreappendMessagesaved the reply with no timeline. The activity trail, question recaps, claim check and image placements were all gone.run-event-projectionignored every timeline event after step 200, so phone progress froze.This came out of comparing the app against an upstream long-thread performance change.
What
The projector still keeps every step internally. Only
snapshot()is bounded, throughboundGenerationTimelineSteps(renderer/shared/generation-timeline.ts).Fold order: the oldest settled tool steps drop first, in this order:
run_commandWhen a drop leaves two finished thoughts side by side, they merge. Reasoning stays fully covered and each thought stays where it happened.
Careful passes come first. They never join two reply text rows, never change the first step of a row that holds an image, visual or subagent (that would remount iframes), never fold
subagentor recording steps, and keep the newest 40 steps.If that is not enough, for example a run that writes a line before every call, later passes drop regardless. Moved text is better than losing the whole timeline.
Running steps never fold.
Folding is sticky: the projector remembers what it folded, so a step that settles later cannot bring back an earlier-dropped one.
orderis renumbered. Step ids and publiccall-Nids are unchanged.No protocol revision: the phones already accept up to 200 steps.
Trade-off: past 200 steps, the summary sentence counts only the kept steps. The screenshot shows "Explored 200 searches" for 210 calls.
Screenshots
A 210-call run in the Electron e2e harness.
Files (light, dark, and trail open) in the project folder
upstream-two-changes/:A-before-light.pngA-after-light.pngA-after-dark-trail-open.pngTests
5 long-run cases at the end of
main/services/generation-timeline.test.ts:The new and changed cases fail on the first version of this branch.
The generation-timeline, run-event-projection, chat-store-core and presentation suites pass, as do
tscand eslint.Flaky tests
tests/e2e/inline-visuals.spec.ts:47failed once in the Linux build x64 job on head f716caf, and the Linux x64/arm64 packaging jobs failed after it. This spec is already on the known-flaky list, and this PR does not touch inline visuals. Run: https://github.com/sambitcreate/aiden-agent/actions/runs/40929433242/job/123643765064. The failed jobs were rerun once.Reviews
Two review rounds. Fixed from them: dropped steps reappearing, row-key remounts, joined text rows, thoughts moving above tools, narrated runs losing the cap, and reopened merged thoughts.
Not fixed: if
reconcileContentOffsetlater re-anchors offsets, a decision made earlier can join text rows. This only happens in turns over about 40 steps, and nothing breaks parsing.Docs
docs/aiden-remote-api-v1.md(timelinebullet),docs/plans/long-thread-payload-upgrade-plan.md,docs/plans/README.md, and.memory/generation-timeline-step-bound.md.Generated by Claude Code