[codex] Add serverless container wake path#103
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Review — Lean Explicit Intent Refactor (
|
Summary
Adds proxy-local serverless container support:
sleepthrough the normal agent status channel.wake_started, starts the local container, waits for readiness, then proxies the held request.127.0.0.1:18080only on proxy nodes that host a local replica for that service.runtimeDesiredState,trafficState, andobservedPhase, so expected-state is a projection of intent instead of inferred lifecycle history.deployedConfig, so changing enablement, ports, or related service config applies on the next rollout.Manual alpha cutover note
This PR replaces the old overloaded deployment
status/desiredmodel with explicit state fields. On an existing alpha database,drizzle-kit pushcannot infer which pre-existing deployments should receive active traffic. I can manually repair any broken deployments after deploy.Use these rules for manual repair:
runtime_desired_state = 'running',traffic_state = 'active', andobserved_phase = 'healthy'or'running'based on the actual agent/container state.runtime_desired_state = 'stopped',traffic_state = 'active',observed_phase = 'sleeping', andcontainer_id = NULL.runtime_desired_state = 'removed'andtraffic_state = 'inactive'.Because the product is alpha, the simpler alternative is to redeploy affected services after the PR lands, which creates fresh deployments under the new state model.
Validation
pnpm exec biome format --write lib/agent-status.ts lib/agent/expected-state.ts tests/agent-status.test.ts tests/expected-state.test.tspnpm exec tsc --noEmitpnpm exec vitest run tests/agent-status.test.ts tests/expected-state.test.tspnpm testgit diff --checkgo test ./...go test -count=1 -race ./internal/serverless