Skip to content

fix(coding-agent): restore compaction preflight events#340

Closed
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/restore-compaction-preflight-events
Closed

fix(coding-agent): restore compaction preflight events#340
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/restore-compaction-preflight-events

Conversation

@minpeter

@minpeter minpeter commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore observable auto-compaction lifecycle events for auth/preparation preflight failures
  • emit a matching non-error terminal event when an owned preflight attempt cannot proceed
  • preserve PR fix(coding-agent): stabilize compaction lifecycle #310 stale-controller protection, including synchronous compaction_start listener supersession
  • strengthen the existing overflow characterization and add no-preparation/reentrant-listener coverage

Root cause and attribution

Current main inherited the regression from PR #310 commit b3f643e915: _runAutoCompaction() moved compaction_start below auth/preparation validation and removed early terminal events. The existing no-auth characterization consequently observed zero starts instead of two.

The exact owner boundary was reproduced before this change:

This repair is isolated from PR #328 and contains only the three compaction lifecycle files shown in the diff.

Verification

  • Existing focused RED: reproduced expected [] to have a length of 2 but got +0
  • Focused GREEN: 1/1 passed
  • Final compaction domain: 45 files, 366 tests passed
  • Full workspace after build:
    • coding-agent: 558 files passed / 4 skipped
    • 4,602 tests passed / 32 skipped
    • all remaining workspace suites passed
  • Root npm run build: passed
  • Root npm run check: passed, including Biome, dependency/import/lock checks, tsgo, browser smoke, web UI, and Neo build/vet/tests
  • Real source CLI isolation/auth self-check: 9/9 passed
  • Real source CLI RPC with localhost OpenAI Responses mock: passed
  • Real source CLI deterministic mock loop with localhost OpenAI Completions mock: passed
  • Independent final read-only review: PASS - no actionable findings

Evidence

Local evidence index:

local-ignore/qa-evidence/20260724-compaction-preflight-lifecycle/EVIDENCE.md

Supporting source-CLI artifacts:

  • local-ignore/qa-evidence/20260725-compaction-preflight-rpc/
  • local-ignore/qa-evidence/20260725-compaction-preflight-mock/

Original CI attribution:

local-ignore/qa-evidence/20260724-compaction-progress-live-cdp-final/ci-current-main-attribution/attribution.md


Summary by cubic

Restores auto-compaction preflight lifecycle events and balances start/end signals around auth/preparation checks. Prevents stale terminal events when a start listener supersedes controller ownership.

  • Bug Fixes
    • Emit compaction_start before auth/prep; on preflight reject, emit a matching non-error compaction_end; recheck ownership after start to avoid stale ends.
    • Preserve overflow recovery and controller-ownership safeguards; add tests for no-prep and listener-abort cases; update changes.md.

Written for commit d027216. Summary will update on new commits.

Review in cubic

@minpeter

Copy link
Copy Markdown
Contributor Author

Superseded by the current-main ownership fix at minpeter@e1d0c4d on fix/compaction-preflight-ownership-current-main. Live main already restored balanced preflight start/end events; that commit isolates the remaining synchronous-listener ownership hole so an aborted or superseded attempt cannot emit a stale terminal event. Draft PR creation is currently blocked by GitHub’s critical “Incident with Pull Requests” outage (GraphQL request 966C:2882C:1FB40D:262C04:6A63C18F; REST request D97A:2882C:1FD2CD:2651DE:6A63C1CA).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant