Skip to content

Surface missing credential run failures#1915

Merged
3mdistal merged 7 commits into
mainfrom
codex/ana-usability-01-run-status
Jul 10, 2026
Merged

Surface missing credential run failures#1915
3mdistal merged 7 commits into
mainfrom
codex/ana-usability-01-run-status

Conversation

@3mdistal

@3mdistal 3mdistal commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • treat missing_api_key terminal events as errored in run reconciliation and direct run finalization
  • keep earlier real stream errors from being reconciled away by later terminal success events
  • surface completed rows with terminal_reason=missing_api_key as actionable missing-credential chat failures
  • recognize modern error:missing_credentials recovery and fail any completed row carrying an explicit error:* reason
  • preserve recoverable continuation error chunks as errored while successful continuation checkpoints remain completed
  • add focused regression tests and a patch changeset for @agent-native/core

Verification

  • node_modules/.bin/oxfmt --check packages/core/src/agent/run-manager.ts packages/core/src/agent/run-manager.spec.ts packages/core/src/agent/run-store.ts packages/core/src/agent/run-store.spec.ts packages/core/src/client/agent-chat-adapter.ts packages/core/src/client/agent-chat-adapter.spec.ts
  • cd packages/core && node_modules/.bin/vitest --run src/agent/production-agent.spec.ts src/agent/production-agent.chain-continuation.spec.ts src/agent/run-manager.spec.ts src/agent/run-store.spec.ts src/client/agent-chat-adapter.spec.ts src/agent/run-loop-with-resume.spec.ts src/agent/run-store.durable-background.spec.ts (450 tests)
  • cd packages/core && pnpm typecheck
  • git diff --check
  • Opus planning: .task-sweep/logs/claude-opus-plan-20260706-134914.log, .task-sweep/logs/claude-opus-plan-output-20260706-134914.jsonl
  • Opus review: .task-sweep/logs/claude-opus-final-review-20260706-180931.log, .task-sweep/logs/claude-opus-final-review-output-20260706-180931.jsonl
  • Fable refresh planning: .task-sweep/logs/claude-fable-5-refresh-plan-retry-20260709-212943.debug.log, .task-sweep/logs/claude-fable-5-refresh-plan-retry-output-20260709-212943.jsonl
  • Fable refresh review: .task-sweep/logs/claude-fable-5-refresh-review-20260709-214244.debug.log, .task-sweep/logs/claude-fable-5-refresh-review-output-20260709-214244.jsonl (no blockers; approved)

Manual story

As a hosted Analytics user without the required model credential, asking the agent a question now lands in a clear missing-credential failure state instead of a completed/successful run. Mid-stream errors and missing-key terminal events persist as failed run rows with error fields, while ordinary successful runs still complete.

Notes

  • Refreshed onto current main while preserving its reconnect, stale-run, and continuation behavior.
  • Three actionable Builder review findings were fixed, answered in their threads, and resolved.
  • Ready for review and approved; CI is rerunning on the latest conflict-free head.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Visual recap — generation failed

The visual recap could not be generated for this pull request. This is informational only and does not block the PR.

Diagnostic:

No plan URL: create-visual-recap failed 422 Unprocessable Entity: {"error":"Could not parse expression with acorn"}

Agent output: create-visual-recap failed 422 Unprocessable Entity: {"error":"Could not parse expression with acorn"}

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

…1-run-status

# Conflicts:
#	packages/core/src/client/agent-chat-adapter.spec.ts
builder-io-integration[bot]

This comment was marked as outdated.

builder-io-integration[bot]

This comment was marked as outdated.

builder-io-integration[bot]

This comment was marked as outdated.

…1-run-status

# Conflicts:
#	packages/core/src/agent/production-agent.chain-continuation.spec.ts
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration 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.

Builder reviewed your changes and found 1 potential issue 🟡

Review Details

This incremental update broadens the original run-failure fix across run-manager, run-store, production-agent, and the shared client adapter. The new head correctly addresses the previously open concerns I rechecked: background terminal recovery now clears chunk-scoped recoverable error state when the followed run id changes, and run reconciliation bounds its terminal-event scan with an explicit limit while still preserving the intended precedence of real failures over later success markers. I resolved those stale review threads.

Risk assessment: standard. The code touches shared run lifecycle, background continuation handoff, and chat recovery paths that are reused across surfaces, so mistakes here can silently misclassify failed runs.

Key finding:

  • 🟡 startRun() still invokes onComplete before normalizing a pending terminal error / missing_api_key event into the final errored status. Downstream consumers in production-agent therefore still see these runs as completed during completion handling, which can incorrectly mark tracked progress as succeeded and skip worker error diagnostics.

The overall direction remains sound, and the added regression coverage around missing credentials, error:* terminal reasons, and continuation chunk terminalization is strong.

🧪 Browser testing: Will run after this review (PR touches UI/client chat behavior)

Comment thread packages/core/src/agent/run-manager.ts Outdated
@3mdistal 3mdistal merged commit 43d1217 into main Jul 10, 2026
103 of 104 checks passed
@3mdistal 3mdistal deleted the codex/ana-usability-01-run-status branch July 10, 2026 12:57
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.

2 participants