Skip to content

fix(lifecycle): clear stale delegated quit blockers - #1641

Open
wen2zhou wants to merge 3 commits into
aipoch:mainfrom
wen2zhou:fix/ended-session-subagent-quit
Open

fix(lifecycle): clear stale delegated quit blockers#1641
wen2zhou wants to merge 3 commits into
aipoch:mainfrom
wen2zhou:fix/ended-session-subagent-quit

Conversation

@wen2zhou

Copy link
Copy Markdown
Contributor

Problem

An ended session could still block application quit with “Subagents are still running”. The durable session was terminal, but the main-process delegated-work projection could retain an older running snapshot because projection maintenance happened outside the authoritative persistence seam.

Proposed change

  • Refresh delegated activity from durable session commits so terminal attempts synchronously leave the quit-blocker index.
  • Introduce SessionCommitProjectionOwner as the single adapter around the session repository commit seam.
  • Route the coordinator and all persistence owners through that adapter.
  • Keep renderer publication as best-effort derived state, separate from commit-safety projection maintenance.
  • Add behavioral and architecture coverage for running-to-terminal transitions and module ownership.

Scope and non-goals

  • No database schema, renderer UI, or user-visible copy changes.
  • No change to which genuinely active delegated attempts block quit.
  • The branch was not rebased only because main advanced; the contribution guide says to update only for conflicts or maintainer request, and a merge precheck found no conflicts.

Acceptance criteria and validation

The following checks ran after the final material edit:

  • Durable running-to-terminal commit removes the session from delegated quit blockers -> npm test -> relevant coordinator regression passed.
  • Persistence facade owns the commit adapter and all owners route through it -> npm test -> session-persistence architecture and contract tests passed.
  • Main-process interfaces remain type-safe -> npm run typecheck -> passed for node and web configurations.
  • Changed source and configuration satisfy lint/format rules -> npm run lint and targeted npx prettier --check ... -> passed; lint reported two pre-existing Prettier warnings in unrelated ACP files.
  • Full portable suite -> npm test -> 18,740 tests passed; two completion-gate assertions failed in renderer files unchanged from fixed point 1fb047b8. Current origin/main already has those files within their gates (780/780 and 699/700), so exact-head PR CI is authoritative for the merge result.
  • Independent Standards and Spec reviews -> no remaining findings after targeted fixes.

Uncovered local risk: platform-specific CI lanes were not reproduced beyond macOS development startup and normal quit behavior. PR Gate and Nightly remain authoritative for other platforms.

Review focus

  • Whether SessionCommitProjectionOwner.observeRepository() is the correct authoritative commit seam.
  • Synchronous projection updates after successful saveSession and saveCommittedProjectSession calls.
  • Proxy forwarding and method binding for repository methods not explicitly wrapped.

@github-actions github-actions Bot added the bug Something isn't working label Aug 24, 2026
@wen2zhou
wen2zhou marked this pull request as draft August 24, 2026 09:07
@wen2zhou
wen2zhou marked this pull request as ready for review August 24, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant