Skip to content

refactor: centralize run status and simplify runtime ownership - #4

Merged
mewcoder merged 18 commits into
refactorfrom
agent/unify-run-status-writes
Jul 26, 2026
Merged

refactor: centralize run status and simplify runtime ownership#4
mewcoder merged 18 commits into
refactorfrom
agent/unify-run-status-writes

Conversation

@mewcoder

@mewcoder mewcoder commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Why

Run status had several secondary write paths and failure windows, while Runtime Host lifecycle state still exposed lower-level mutation APIs. That made Run/Conversation projection convergence and worker cleanup harder to reason about.

What

The original refactor remains intact, including the registered Runtime Host execution chain. This follow-up adds thirteen isolated commits:

  1. fix(runtime): keep dependency sync build-free
    • read bundled plugin IDs from a pure manifest so dependency verification does not import unbuilt agent packages
  2. refactor(run): route launch failures through status owner
    • send runtime submit failures through RunStatusService
  3. refactor(run): converge stale cancellation centrally
    • route no-handle cancellation through the same Run/Conversation/SSE transition owner
  4. fix(run): release failed launch claims
    • reconcile a claimed Conversation when message or Run creation fails, without overwriting a newer active run
  5. test(run): guard status ownership boundaries
    • prevent new production writes outside RunStatusService
  6. fix(run): reconcile stale conversation projections
    • repair Conversation projections left running after restart when no active Run exists
  7. refactor(runtime): encapsulate worker pool lifecycle
    • use composition so RuntimeHost cannot bypass registry eviction with raw WorkerPool.remove
  8. chore: align run refactor quality gates
    • normalize formatting and satisfy lint rules
  9. fix(ci): satisfy server lint gates
    • clear the original PR's deferred server lint failures exposed after runtime typecheck was fixed
  10. fix(test): validate runtime plugin identifiers
    • align the stale closed-enum DTO test with the open runtime plugin identifier contract
  11. fix(run): guard conversation projection ownership
    • add Conversation.activeRunId compare-and-set ownership so an older Run cannot overwrite a newer Run's Conversation projection during steering
  12. fix(test): align conversation projection mock
    • update the Runtime Host upstream test double for the new Conversation projection port
  13. fix(test): satisfy run status lint
    • remove an unused test binding caught by the full lint gate

The registered execution/tunnel chain is preserved.

Validation

GitHub Actions Server workflow #44 passed:

  • adapters TypeScript: pass
  • runtime TypeScript: pass
  • server TypeScript: pass
  • server ESLint/Prettier: pass
  • adapters full suite: 14 files, 216 tests pass
  • runtime full suite: 24 files, 227 tests pass
  • server full suite: 92 files, 806 tests pass

@mewcoder
mewcoder merged commit 310b3a1 into refactor Jul 26, 2026
1 check passed
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