feat(controller): add typed runtime failure reasons#151
Open
OnlyTerp wants to merge 2 commits into
Open
Conversation
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.
This was referenced Jun 22, 2026
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
RuntimeFailureReasontype.reason/codemetadata to launch/switch results and launch-progress SSE payloads while preserving rawmessage/detailstrings./launch/:recipeIdand chat-proxy 503 errors where available.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 failnpm --prefix controller run typechecknpm --prefix controller run lintKnown upstream check
npm run check:contractscurrently fails on currentmainwith duplicateAggregatedSessionexports infrontend/src/app/api/agent/sessions/all/route.tsandfrontend/src/features/agent/session-contracts.ts; this PR does not touch those files.Notes
reason/codefields are optional; existing raw error strings remain intact for compatibility.