Skip to content

feat(controller): add typed runtime failure reasons#151

Open
OnlyTerp wants to merge 2 commits into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-001-runtime-failure-taxonomy
Open

feat(controller): add typed runtime failure reasons#151
OnlyTerp wants to merge 2 commits into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-001-runtime-failure-taxonomy

Conversation

@OnlyTerp

Copy link
Copy Markdown

Summary

  • Adds a shared RuntimeFailureReason type.
  • Attaches optional reason/code metadata to launch/switch results and launch-progress SSE payloads while preserving raw message/detail strings.
  • Introduces a focused launch failure classifier for common local runtime failures.
  • Surfaces typed reasons in /launch/:recipeId and chat-proxy 503 errors where available.
  • Rebased onto current main; adapted the frontend launch-progress type/equality changes to the current consolidated files.

Verification

  • bun test tests/controller/integration/launch-failure-classifier.test.ts tests/controller/integration/observability-contracts.test.ts — 16 pass, 0 fail
  • npm --prefix controller run typecheck
  • npm --prefix controller run lint

Known upstream check

  • npm run check:contracts currently fails on current main with duplicate AggregatedSession exports in frontend/src/app/api/agent/sessions/all/route.ts and frontend/src/features/agent/session-contracts.ts; this PR does not touch those files.

Notes

  • No DB migrations or recipe schema changes.
  • No UI redesign, crash-loop budget, readiness panel, or auto-launch behavior.
  • New reason/code fields are optional; existing raw error strings remain intact for compatibility.

terp added 2 commits June 21, 2026 15:48
- Add shared RuntimeFailureReason type.
- Add optional reason/code to LaunchResult, EnsureActiveResult, SetActiveRecipeResult, and launch-progress SSE payload.
- Add launch-failure classifier with conservative heuristics for missing binary, permission, port, unsupported flag, OOM, context/KV, early exit, timeout, model not served, backend unreachable.
- Populate reason/code in process-manager and engine-coordinator failure paths.
- Extend HttpStatus serialization and route/proxy error responses to include optional reason/code.
- Add classifier unit tests.
- Preserve raw message/detail strings. No DB/recipe schema changes, no crash-loop budget, no auto-launch.
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