Skip to content

fix(runtime): surface typed harness provider failures - #336

Merged
kjgbot merged 2 commits into
mainfrom
fix/harness-provider-errors
Sep 8, 2026
Merged

kjgbot merged 2 commits into
mainfrom
fix/harness-provider-errors

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Recognized model-provider failures currently reach agent handlers as ordinary nonzero harness results, so a handler can replace an actionable quota or authentication error with “exit 1.” The shared runtime now rejects these failures with HarnessProviderError before returning output to the handler. No agent repository changes are needed.

The runtime classifies usage/credit limits, rate limits, authentication failures, context limits, provider request timeouts, and availability errors. Messages use safe templates, with a validated provider-reported reset time when available. Successful runs, OS kills, and unrecognized process failures retain their existing result contract. No automatic retry, credential switching, or paid fallback is introduced.

harness.provider_error and runner.handler.error carry the structured providerFailure; the runner's error text is actionable for existing run-record consumers. Original diagnostics remain accessible on the error as a non-enumerable result. Cloud customer-notice rendering can consume the structured message without duplicating CLI parsing.

Validation: the unchanged-handler regression failed before the fix; all 174 runtime tests and runtime typecheck now pass. Coverage includes Claude/Codex error envelopes, stdout/stderr diagnostics, invalid reset hints, safe serialization, successful/unknown/OS-kill results, no retry, and no task output reaching a success path. No live customer task was rerun.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b52bc5ee-0c23-4a55-b0d6-83db60102936


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/runtime/src/harness-provider-error.ts Outdated
@kjgbot
kjgbot merged commit 93f4023 into main Sep 8, 2026
4 checks passed
@kjgbot
kjgbot deleted the fix/harness-provider-errors branch September 8, 2026 17:47
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