Skip to content

fix(coding-agent): expose failed compaction attempts#326

Draft
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/compaction-attempt-observability
Draft

fix(coding-agent): expose failed compaction attempts#326
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/compaction-attempt-observability

Conversation

@minpeter

@minpeter minpeter commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publish compaction_start once an automatic compaction owns its model/controller
  • do so before authentication/preparation can fail
  • preserve the one-overflow-retry attempt when preparation fails before a provider retry

This is a one-commit follow-up to merged PR #310, based directly on its merge result.

Root cause

The final #310 controller-supersession fix moved compaction_start after authentication and request preparation. An
overflow compaction that failed during those early preparation steps therefore consumed/released internal attempt
state without publishing the attempt. The next prompt could not prove that the overflow recovery had been retried,
and the established no-auth regression observed zero starts instead of two independent attempts.

The event now emits after model/controller ownership is proven but before fallible authentication/preparation. A
superseded controller still cannot emit; a valid owned attempt remains observable even when preparation returns early.

RED -> GREEN

  • RED on exact merged main:
    • does not consume the overflow compact-and-retry attempt when compaction fails before retrying
    • expected two compaction_start events, received zero
  • GREEN:
    • exact target 1/1
    • agent-session compaction + controller lifecycle group 42/42
    • full compaction/retry/hook matrix 14 files / 121 tests

Verification

  • root build: passed
  • root npm run check: passed
  • real source CLI mock loop: exit 0, one localhost request, expected assistant text, auth unchanged
  • built CLI --help: exit 0
  • built CLI invalid install input: exit 1 with usage

The broader coding-agent full suite has unrelated load-sensitive MCP/app-server/temporary-filesystem failures which
pass directly; no compaction test remains failing.


Summary by cubic

Emit compaction_start as soon as an automatic compaction owns its model/controller, before auth and preparation. This makes early preparation failures visible and preserves the single overflow retry attempt.

Written for commit 62354c2. Summary will update on new commits.

Review in cubic

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