Skip to content

fix(cli): stop unchanged progress feedback loops [risk:high] - #461

Merged
zxch3n merged 2 commits into
mainfrom
codex/fix-operation-progress-feedback
Sep 7, 2026
Merged

fix(cli): stop unchanged progress feedback loops [risk:high]#461
zxch3n merged 2 commits into
mainfrom
codex/fix-operation-progress-feedback

Conversation

@zxch3n

@zxch3n zxch3n commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Risk: 🔴 high | Confidence: high — changes CRDT history write behavior; real-Mirror regression tests and independent review cover convergence and subsequent progress updates.

Related issue

Same-repository fix; no separate tracking issue.

Problem / pressure

Nested create operations (A → B → C) can keep the CLI coordinator reconciling indefinitely. Updating B's progress notifies A's target subscription even when progress has not changed: returning the original history inside Mirror.setState still emits notifications.

Summary

Skip unchanged or absent progress before entering updateHistory. Recompute actual writes against the latest history. Preserve duplicate-ID recovery and monotonic status merging. Add real-Mirror coverage and keep the notification invariant in AGENTS; move explanatory connection-lifetime material into the adjacent README to respect the document size limit.

Before / after

Before After
Nested progress repeatedly wakes its own coordinator; the regression reaches its 20-scan safety guard. The coordinator quiesces after two scans.
Returning unchanged history still notifies Mirror subscribers. Unchanged progress never enters Mirror; later child completion still updates and settles its card.

Test plan

  • Full standalone OSS pnpm check passed on the implementation commit: workspace typechecks, lint, tests, i18n and boundary checks.
  • 145 orchestration/progress tests passed against base bad3c75; the old implementation failed both new regression cases.
  • Independent race/correctness, security/scope, and test reviews found no P0/P1; correctness was re-reviewed after refreshing the base.
  • CI-equivalent static steps pass locally: 45 contribution-policy tests, pnpm run docs check --base origin/main, pnpm format:check, pnpm typecheck, and pnpm check:quick. Document maintenance and formatting are separate from pnpm check.
  • A separate 0.92.0-based diagnostic package passed the feedback reproduction using its embedded Electron runtime. Affected-user workspace validation remains pending.

Context handoff

Instructions for reviewing agents

  • Review focus: Check operation-progress-history.ts and the real-Mirror nested coordinator regression for stable-state quiescence and subsequent completion updates.
  • Decisions to challenge: The preflight read suppresses no-op writes, while the actual updater recomputes against current history; ensure duplicate-ID repair remains recoverable.
  • Plausible failures / evidence gaps: Look for missed concurrent updates or feedback paths; the affected user's original workspace has not yet confirmed recovery.

Authoring context

  • User goal / directives: Fix a reproduced CLI progress feedback loop, add a regression test, and submit the change using the repository PR template.
  • Constraints / non-goals: Preserve operation semantics, persisted schemas, real completion updates, and cloud/local boundaries; exclude captured user data and installation artifacts.
  • Risk-bearing decisions: Suppress a CRDT write before Mirror notification; preserve the latest-state updater and existing duplicate repair rather than globally changing Mirror behavior.
  • Destructive or irreversible behavior: No migration, cleanup, deletion, or deployment is introduced; existing history repair and recovery behavior remain intact.
  • Deliberately not done or tested: No broad scheduler redesign or production rollout; validation on the original affected workspace is pending.
  • Unknowns / confidence: High confidence in the reproduced loop fix from real-Mirror tests and independent reviews; no claim that every reported CLI stall has the same cause.

Skip unchanged progress before entering Mirror, which notifies subscribers even for no-op updates. Cover nested A -> B -> C reconciliation with real Mirror subscriptions.

Model: gpt-6
Move connection-lifetime explanations to README while retaining binding constraints in AGENTS.

Model: gpt-6
@zxch3n
zxch3n marked this pull request as ready for review September 7, 2026 09:26
@zxch3n
zxch3n merged commit b2fa563 into main Sep 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant