Skip to content

fix(api): release-audit follow-ups for the agent API work - #9910

Merged
waleedlatif1 merged 17 commits into
stagingfrom
fix/agent-api-release-audit
Nov 11, 2026
Merged

waleedlatif1 merged 17 commits into
stagingfrom
fix/agent-api-release-audit

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Follow-ups from independent pre-release audits of #9902, #9904, and #9905 (all on staging, unreleased).

Summary

  • v2 error bodies carry requestId (the same id as the x-request-id header; quote it to support) instead of traceId, which logs already use for the OTel trace id. Unreleased, so renaming now is safe.
  • Validation errors name the failing field once (query.limit: ..., no doubled label); the CLI shows the flag instead (--sort-by: ...).
  • Apply workflow operations: withheld block types are refused before taking the workflow row lock; a failed re-read under the lock is a 500, not a misleading 400; the CONFLICT 409 is documented.
  • New Postgres integration suites prove the operations conflict guard (no false conflict on loops/parallels/legacy blocks; a concurrent write gets 409; two concurrent applies lose nothing) and the workspace schedules list (matches the per-workflow live list, excludes archived/undeployed, pages without repeats across ties).
  • sim login --expires-in without --method now picks the API-key flow instead of failing on OAuth servers; when the CLI refuses a mismatched key, the error names the key that was created and how to revoke it instead of saying nothing was stored.
  • logoUrl is published without a regex lookahead so RE2-based validators accept it (same accepted values).
  • Accurate descriptions for the workflow outline (what it omits) and schedules sortBy=createdAt (rows are recreated per deploy); v2 conventions skill updated; removed a test half that could not fail.

Test plan

  • Targeted vitest: v2 response, blank query values, chat deployments route, CLI poll route, apply-workflow-operations, CLI naming and auth
  • check:openapi, mcp-operations, cli-api, cli-docs, docs-manifest, v2-route-table, api-validation:strict, test-patterns
  • CI integration: apply-workflow-operations.integration.ts, workspace-schedules.integration.ts, members.integration.ts
  • CI type-check and audits

A message that already leads with its field label no longer repeats it after
the location prefix, and the CLI restates the prefix as the flag the caller
typed instead of rewriting it to query.--flag.
The id in error bodies is the request id that x-request-id carries and logs
store as requestId; traceId already means the OTel trace id in logs, so a
search by the published value found nothing.
Only null values are dropped, every sub-block hidden from agents is dropped
(some are real configuration), and blocks whose parent container is gone are
left out, so point readers at Get workflow state for the full configuration.
Adds an integration suite for listWorkspaceLiveSchedulesPage: it returns the
rows the per-workflow live list reports, leaves out archived, undeployed and
other-workspace workflows, and pages through createdAt ties without repeats or
gaps. sortBy=createdAt now says that each deploy creates new schedule rows.
sim login --expires-in without --method failed on servers that offer OAuth,
because OAuth was chosen and then refused the flag; a lifetime now selects the
API-key handoff. A refused handoff key no longer says nothing was stored: it
already exists on the account, so the CLI points at how to revoke it.
RE2-based validators (Go, Rust, many gateways) reject lookaheads, so the
OpenAPI pattern for logoUrl could not be compiled there. The rewrite accepts
and refuses exactly the same values.
The poll contract strips unknown keys and the route never reads them, so
sending access and expiresInDays in the body proved nothing. The test keeps
checking that the approval's access and lifetime reach the mint.
applyWorkflowOperations now hands the persistence primitive a reader, which
skipped its pre-lock withheld-block check, so a refused batch took the row lock
and re-read the graph first. The use case checks the graph it composed before
writing. A failed re-read under the lock is now an internal error instead of a
400 saying the workflow has no state.
…ostgres

Holds the workflow row lock to force each interleaving: an unchanged workflow
with containers and a migrated legacy block commits, a write that lands after
the base read is refused as a conflict, and of two concurrent applies one
commits and the other is refused with nothing lost.
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 11, 2026 11:26pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues remain.

Summary

This PR tightens API errors, workflow edits, CLI login, and their documentation.

  • Workflow batches refuse stale edits instead of overwriting newer drafts.
  • Expiring CLI logins use API-key pairing and name keys that need revoking.
  • V2 error bodies call the request identifier requestId to match the response header.
  • V2 validation errors name each field once and the CLI shows its matching flag.
  • Workflow outline descriptions name the settings and blocks they leave out.
  • Schedule list descriptions explain how deploys affect createdAt ordering.
  • The logoUrl schema uses a pattern RE2-based validators can read.

Reviews (3) · Last reviewed commit: "fix(cli): probe the endpoint before an -..." · 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.

All reported issues were addressed across 32 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-cli/src/commands/auth.ts Resolved
The poll response now carries the minted key's name (an additive, optional
field), so the CLI tells the caller exactly which key in Settings → API keys
to revoke, falling back to the key id for an older server. Restores the route
context argument the trimmed poll test dropped.
The applies and the lock-wait poll started inside the lock holder's
transaction callback, so the transaction tripwire refused them. They now leave
that context, the applies run in a permission-group scope as routes do, and an
apply that settles early is reported without awaiting the ones queued on the
held lock.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread packages/sim-cli/src/commands/auth.ts Resolved

@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 35 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-cli/src/commands/auth.ts Resolved
A second FOR UPDATE waiter queues on the first waiter's tuple lock, so
pg_blocking_pids names that waiter rather than the holder; the barrier now
walks the chain.
--expires-in without --method chose the handoff before the reachability
probe, so a mistyped endpoint printed a pairing code and polled instead of
failing fast. The probe now runs first. A refused key from a server that does
not report its name is described by the name pattern and time it was made.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

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

This branch was previously deployed

1 inactive deployment
Preview — 5b8e64f9 Deployed Nov 11, 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