Skip to content

Commit 5bbf4e7

Browse files
authored
feat(api): failing block on polled runs, deployed input schema, paused-runs list, and applied limits (#9906)
* feat(api): attribute polled run failures, deployed input schema, paused-run list, and applied run limits - GET /v2/workflows/{id}/runs/{runId} reads the failing block back from the run's recorded trace, withheld when the viewer's permission group hides execution data - GET /v2/workflows/{id} adds inputSchema for the active deployment's API run input - GET /v2/workflows/runs/paused lists a workspace's runs waiting on human input, projecting pause points exactly as the run detail does - Execute responses report executionTimeoutSeconds; GET /v2/billing/status adds plan limits * fix(api): respect the paused-run page cap in the CLI and keep waiting pause points under the cap - CLI generator carries a numeric field's contract maximum; the pager never requests a page above it while still paging to the caller's total --limit - Pause point cap keeps points not yet resumed before resumed history, so a run that paused again is never listed without its waiting point (run detail and paused list) * improvement(api): reuse FailedTraceBlock and sort pause points once when capping * fix(api): custom-block trace boundary, legacy pause point arrays, and list point selection - A custom block is an opaque trace boundary for failing-block attribution - The paused-run list reads object and legacy array pause_points - The list selects waiting human points before the per-run cap, reads points in waves that stop once the page budget is spent, and shares one waiting predicate - Resume response schemas omit executionTimeoutSeconds - Drop a non-null assertion from the CLI page cap test * fix(api): attribute concurrent failures to the stored error's block and never fail a workflow read on its deployment - Failing-block attribution prefers the span the stored error names, else the failure that ended first, else none; the block error prefix has one owner - The workflow read degrades inputSchema to null when the deployment cannot be read or its schema has an unexpected shape - Integration cases for time-only, archived, and cross-workspace exclusion * fix(api): consistent trace walk, block-named error attribution, required applied timeout, and ungated input schema - Failing-block attribution walks spans as hasUnhandledError does, through successful blocks, with one shared successful-boundary rule - An error message headed by the failing block's name is attributed to it even when the name reads as a run-level failure - executionTimeoutSeconds is required (nullable) on Execute workflow responses - The workflow read takes inputSchema from the active version row, not isDeployed - Pause cap wording: unresolved points are kept in preference, listed earliest first - Regenerate the CLI API the previous contract wording left stale * fix(api): parse resume responses with the resume schema in e2e scripts and regenerate the CLI API on staging - Stop-after and pinned-execute e2e scripts parse resume responses with v2ResumeWorkflowDataSchema, which omits executionTimeoutSeconds - Regenerate the CLI API against the merged staging contracts * fix(api): parse the stop-after e2e resume helper's response with the resume schema
1 parent 9b58238 commit 5bbf4e7

47 files changed

Lines changed: 2475 additions & 225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/api-reference/(generated)/workflow-runs/meta.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pages": [
33
"listWorkflowRunsV2",
4+
"listPausedWorkflowRunsV2",
45
"getWorkflowRunV2",
56
"downloadWorkflowRunFileV2",
67
"resumeWorkflowRunV2",

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7525,6 +7525,31 @@ sim workflows runs get <runId> [options]
75257525

75267526
API request and response schemas: [getWorkflowRun](/api-reference/workflow-runs/getWorkflowRunV2).
75277527

7528+
### sim workflows runs paused
7529+
7530+
List runs waiting on human input across the workspace
7531+
7532+
```bash
7533+
sim workflows runs paused [options]
7534+
```
7535+
7536+
**Options**
7537+
7538+
<CommandTable>
7539+
7540+
| Option | Required | Description |
7541+
| --- | --- | --- |
7542+
| `--include-output` | No | Include each pause point's reviewer `display` content when true. |
7543+
| `--no-include-output` | No | Send --include-output as false. |
7544+
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
7545+
| `--cursor <value>` | No | Continue from nextCursor returned by a previous result. |
7546+
| `--sort-by <value>` | No | Field used to sort the result. Defaults to "pausedAt". Accepted values: `pausedAt`. |
7547+
| `--sort-order <value>` | No | Sort direction. Defaults to "desc". Accepted values: `asc`, `desc`. |
7548+
7549+
</CommandTable>
7550+
7551+
API request and response schemas: [listPausedRuns](/api-reference/workflow-runs/listPausedWorkflowRunsV2).
7552+
75287553
### sim workflows runs list
75297554

75307555
List runs for a workflow

‎apps/docs/content/docs/cli/workflows.mdx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,29 @@ sim workflows runs list [options]
806806

807807
API request and response schemas: [listWorkflowRuns](/api-reference/workflow-runs/listWorkflowRunsV2).
808808

809+
### List runs waiting on human input across the workspace
810+
811+
```bash
812+
sim workflows runs paused [options]
813+
```
814+
815+
**Options**
816+
817+
<CommandTable>
818+
819+
| Option | Required | Description |
820+
| --- | --- | --- |
821+
| `--include-output` | No | Include each pause point's reviewer `display` content when true. |
822+
| `--no-include-output` | No | Send --include-output as false. |
823+
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
824+
| `--cursor <value>` | No | Continue from nextCursor returned by a previous result. |
825+
| `--sort-by <value>` | No | Field used to sort the result. Defaults to "pausedAt". Accepted values: `pausedAt`. |
826+
| `--sort-order <value>` | No | Sort direction. Defaults to "desc". Accepted values: `asc`, `desc`. |
827+
828+
</CommandTable>
829+
830+
API request and response schemas: [listPausedRuns](/api-reference/workflow-runs/listPausedWorkflowRunsV2).
831+
809832
### Show run status
810833

811834
Requested outputs are included in JSON or YAML output.

‎apps/docs/openapi-v2-billing.json‎

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"get": {
4040
"operationId": "getBillingStatus",
4141
"summary": "Get billing status",
42-
"description": "Get the current plan, billing standing, credit allowance, and storage quota. Pooled `credits` and `storage` are visible only to callers who can manage the payer's billing; workspace API keys receive null for both. Use List billing logs for credit history.\n\nOAuth scope: `api:read`.",
42+
"description": "Get the current plan, billing standing, credit allowance, storage quota, and plan limits on runs. Pooled `credits` and `storage` are visible only to callers who can manage the payer's billing; workspace API keys receive null for both, but every caller reads `limits`. Use List billing logs for credit history.\n\nOAuth scope: `api:read`.",
4343
"x-sim-operation": "billing.status.read",
4444
"x-oauth-scope": "api:read",
4545
"tags": ["Billing"],
@@ -105,6 +105,11 @@
105105
"usedBytes": 5242880,
106106
"limitBytes": 1073741824,
107107
"percentUsed": 0.48828125
108+
},
109+
"limits": {
110+
"maxSyncExecutionTimeoutSeconds": 3000,
111+
"maxAsyncExecutionTimeoutSeconds": 5400,
112+
"maxConcurrentExecutions": 50
108113
}
109114
}
110115
}
@@ -717,12 +722,61 @@
717722
}
718723
],
719724
"description": "The payer's storage consumption and quota, or null when the caller cannot manage that payer's billing. Always null for a workspace API key."
725+
},
726+
"limits": {
727+
"type": "object",
728+
"properties": {
729+
"maxSyncExecutionTimeoutSeconds": {
730+
"anyOf": [
731+
{
732+
"type": "number",
733+
"exclusiveMinimum": 0
734+
},
735+
{
736+
"type": "null"
737+
}
738+
],
739+
"description": "Longest a synchronous run may execute, in seconds, or null when synchronous runs are not time-limited."
740+
},
741+
"maxAsyncExecutionTimeoutSeconds": {
742+
"anyOf": [
743+
{
744+
"type": "number",
745+
"exclusiveMinimum": 0
746+
},
747+
{
748+
"type": "null"
749+
}
750+
],
751+
"description": "Longest an asynchronous run may execute, in seconds, or null when asynchronous runs are not time-limited. `executionTimeoutSeconds` on Execute workflow can lower it, never raise it."
752+
},
753+
"maxConcurrentExecutions": {
754+
"anyOf": [
755+
{
756+
"type": "integer",
757+
"exclusiveMinimum": 0,
758+
"maximum": 9007199254740991
759+
},
760+
{
761+
"type": "null"
762+
}
763+
],
764+
"description": "Most runs the payer can have executing at once, across every workspace and member it funds, or null when concurrency is not limited."
765+
}
766+
},
767+
"required": [
768+
"maxSyncExecutionTimeoutSeconds",
769+
"maxAsyncExecutionTimeoutSeconds",
770+
"maxConcurrentExecutions"
771+
],
772+
"additionalProperties": false,
773+
"description": "The payer's plan caps on workflow runs. Visible to every caller that can read the plan, including workspace API keys."
720774
}
721775
},
722-
"required": ["workspaceId", "period", "plan", "status", "credits", "storage"],
776+
"required": ["workspaceId", "period", "plan", "status", "credits", "storage", "limits"],
723777
"additionalProperties": false,
724778
"title": "Billing status",
725-
"description": "Current billing standing, credit allowance, and storage quota."
779+
"description": "Current billing standing, credit allowance, storage quota, and plan limits."
726780
},
727781
"V2BillingStatusResponse": {
728782
"type": "object",
@@ -755,6 +809,11 @@
755809
"usedBytes": 5242880,
756810
"limitBytes": 1073741824,
757811
"percentUsed": 0.48828125
812+
},
813+
"limits": {
814+
"maxSyncExecutionTimeoutSeconds": 3000,
815+
"maxAsyncExecutionTimeoutSeconds": 5400,
816+
"maxConcurrentExecutions": 50
758817
}
759818
}
760819
}

0 commit comments

Comments
 (0)