fix: use canonical instant execution step - #1919
Merged
simple-agent-manager[bot] merged 4 commits intoAug 26, 2026
Merged
Conversation
Contributor
Contributor
Author
|
Refreshing PR event after correcting preflight metadata; no code change. |
simple-agent-manager
Bot
force-pushed
the
sam/small-focused-fix-instant-8snbfk
branch
from
August 26, 2026 03:10
66a4019 to
387a5b0
Compare
simple-agent-manager
Bot
force-pushed
the
sam/small-focused-fix-instant-8snbfk
branch
from
August 26, 2026 04:02
387a5b0 to
980b36e
Compare
|
simple-agent-manager
Bot
deleted the
sam/small-focused-fix-instant-8snbfk
branch
August 26, 2026 05:45
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
runninginstead of out-of-contractagent_running.taskExecutionStep()at the shared contract boundary so write sites can opt into compile-time rejection of invalid execution-step literals where Drizzle exposes the column asstring | null.Validation
pnpm lintpnpm typecheckpnpm test.claude/rules/47-control-loop-io-budget.md)Additional validation:
pnpm --filter @simple-agent-manager/api test -- tests/unit/services/instant-execution-step-contract.test.tsfailed whileagent_runningwas still present.pnpm --filter @simple-agent-manager/shared build && pnpm --filter @simple-agent-manager/api test -- tests/unit/services/instant-execution-step-contract.test.ts tests/unit/services/instant-session.test.tspnpm --filter @simple-agent-manager/shared typecheck && pnpm --filter @simple-agent-manager/api typecheck && pnpm --filter @simple-agent-manager/shared lint && pnpm --filter @simple-agent-manager/api lintpnpm lint && pnpm typecheck && pnpm test && pnpm buildpnpm quality:source-contract-testspnpm --filter @simple-agent-manager/api test:workers -- tests/workers/instant-runtime-recovery-failure.test.tstimed out during local workerd/vitest-pool startup. No test assertion failed; full repo tests and live staging verification passed.Staging Verification (REQUIRED for all code changes — merge-blocking)
Deploy Stagingworkflow triggered manually and passed for this branchapp.sammy.party(staging) using test credentials and actively tested the applicationStaging Verification Evidence
Deploy Stagingrun32928732612completed successfully for branchsam/small-focused-fix-instant-8snbfkat current head980b36e20ebdbdd0f5b5d18dd9168b3860d87eaa. The deploy/app/API/health jobs passed in the original attempt; the failed smoke-tests job was rerun and passed at 2026-08-26T05:01Z, leaving the run conclusionsuccess.98066892079passed the Playwright smoke suite on rerun.e042e533-035b-4671-9715-7801767e56dewith task01M0Y7BEFHKM6J2S89PEWCQZQFusing cf-container profile01KX2N3REWHCAT1QDG927BR52M, then stopped it successfully.execution_step = 'running'.executionStep = 'running'.workspaceDeleted = true.UI Compliance Checklist (Required for UI changes)
End-to-End Verification (Required for multi-component changes)
.claude/rules/10-e2e-verification.md)Data Flow Trace
POST /api/projects/:projectId/sessions/startinapps/api/src/routes/chat-start.ts.executionStep: 'instant_persistence', then callsacceptInstantSession().apps/api/src/services/instant-session.tscompletes ACP startup and updates the task tostatus: 'in_progress',executionStep: taskExecutionStep('running').apps/api/src/lib/mappers.tspreserverunningbecause it is a member ofTASK_EXECUTION_STEPSfrompackages/shared/src/types/task.ts.execution_stepand public APIexecutionSteparerunningfor a live Instant session.Untested Gaps
No known functional gap for this fix. The local worker-pool-only command timed out before executing assertions, but the same seeded invalid literal was corrected and full repo tests plus live staging covered the contract behavior.
Post-Mortem (Required for bug fix PRs)
What broke
Instant runtime marked successfully launched tasks with
executionStep: 'agent_running', which is not in the shared execution-step contract. API mappers converted that invalid literal tonull, so Instant task progress was silently lost in clients.Root cause
Commit
d590ec5626(Make every chat task-backed and forkable, #1572) introduced the raw Instant writer literal without a guard tying it toTASK_EXECUTION_STEPS.Class of bug
Contract drift between a D1 string column writer and the shared TypeScript/API execution-step contract.
Why it wasn't caught
The write site was typed as a raw Drizzle string field, so TypeScript accepted invalid literals. One existing test seeded
agent_running, reinforcing the invalid value instead of rejecting it.Process fix included in this PR
Added a focused writer-inventory guard in
apps/api/tests/unit/services/instant-execution-step-contract.test.tsand a sharedtaskExecutionStep()helper for write sites that need compile-time literal validation.Post-mortem file
tasks/archive/2026-08-26-instant-execution-step-contract.mdSpecialist Review Evidence (Required for agent-authored PRs)
needs-human-reviewlabel added and merge deferred to humanrunningis a semantic enum value from the shared contract.Exceptions (If any)
Agent Preflight (Required)
Classification
External References
/reliability/audits/production-stability-audit-2026-08-25.md, file id01M0XK1XYNB34YB0X6Z41HM542, P2 priority table and sequenced step 6.Codebase Impact Analysis
packages/shared/src/types/task.ts: canonical execution-step contract and typed helper.packages/shared/src/types/index.ts: helper export.apps/api/src/services/instant-session.ts: Instant successful launch task writer.apps/api/tests/unit/services/instant-execution-step-contract.test.ts: writer-inventory guard.apps/api/tests/unit/services/instant-session.test.ts: canonical writer assertion.apps/api/tests/workers/instant-runtime-recovery-failure.test.ts: canonical seed value.Documentation & Specs
N/A: small runtime contract fix; no public contract/docs/spec behavior changed. The API now returns the already-canonical shared execution-step value instead of mapper-normalized
null.Constitution & Risk Check
Checked Principle XI (No Hardcoded Values). The only new literal used in runtime logic is
running, a canonical shared enum member, not a configurable deployment value. Risk is low and scoped to Instant task progress reporting.