Skip to content

fix(api): attribute a polled run's failure only to the block that caused it - #9916

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/release-9912-agent-api-threads
Nov 12, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/release-9912-agent-api-threads

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Addresses the release PR #9912 review threads on the agent API work.

Summary

  • Get workflow run named the trace's failed block for any unrecognized run error, even when that block didn't cause it (e.g. a run-level fault settles first while another branch fails in flight), returning BLOCK_EXECUTION_FAILED with an unrelated block. A block is now named only when it owns the run's error: its name heads the error (Block name: message) or its own recorded error is exactly the run error. Otherwise the run reports EXECUTION_FAILED with no block.
  • Requiring the name prefix alone would have dropped loop and parallel failures, which are recorded without it; the recorded-error match keeps those attributed.
  • The API guide now says the polled run resource names the failing block (it previously said it couldn't), with when the fields are absent.
  • The CLI approval card now says when the requested key never expires, instead of omitting the lifetime.

Test plan

  • New tests: a loop failure recorded without a prefix is attributed to the loop (fails under a prefix-only fix); an unrelated block isn't attributed for a run-level error (fails on the previous code)
  • errors, trace-spans, execution-status-projection tests pass
  • generate/check: openapi, mcp-operations, cli-api, cli-docs

…sed it

A run's stored error was paired with any failed block in its trace when the
message classified as a generic failure, so a run-level fault or a branch that
failed after the settling error reported an unrelated block. The trace read now
names a block only when its name heads the run error or its recorded error is
exactly it, which keeps unprefixed loop and parallel failures attributed.
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 12, 2026 12:49am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

This PR limits failed-run block attribution to blocks whose name or recorded error matches the run error.

  • Polled runs name only the block that owns their error.
  • The CLI approval card says when a key never expires.

No actionable issues found. Review was source-based; no tests were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Stored run error and trace] --> B[Collect unhandled failed blocks]
  B --> C{Block name or recorded error matches?}
  C -- No --> D[Return error without a block]
  C -- Yes --> E{One clear match?}
  E -- Yes --> F[Return error with that block]
  E -- No --> G[Compare finish times]
  G --> H{Unique earliest match?}
  H -- Yes --> F
  H -- No --> D
Loading

Reviews (1) · Last reviewed commit: "fix(cli-auth): say when a requested key ..." · Reviewed by Greptile

@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.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 222ba07 into staging Nov 12, 2026
59 of 60 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/release-9912-agent-api-threads branch November 12, 2026 00:47

This branch was successfully deployed

1 active deployment
Preview — 34da6a07 Deployed Nov 12, 2026 by vercel[bot]
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