Skip to content

fix(runs): say why the backend refused a run instead of that it did - #2794

Draft
camielvs wants to merge 1 commit into
09-23-feat_let_the_agent_name_the_project_and_sessionfrom
09-23-fix_say_why_the_backend_refused_a_run
Draft

camielvs wants to merge 1 commit into
09-23-feat_let_the_agent_name_the_project_and_sessionfrom
09-23-fix_say_why_the_backend_refused_a_run

Conversation

@camielvs

@camielvs camielvs commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

An agent built a pipeline, validated it with zero issues, submitted it, and got
back Failed to create pipeline run. It retried the identical request, failed
identically, went looking for the spec to submit another way, hit a second bug
doing that, and concluded after four minutes:

This appears to be a browser pipeline serialization/submission bug rather than
a problem with the DAG.

It wasn't. The backend had said exactly what was wrong, and we threw it away:

if (!response.ok) {
  throw new Error("Failed to create pipeline run");
}

The response body behind that sentence:

{"detail": [{
  "type": "string_type",
  "loc": ["body", "root_task", "componentRef", "spec", "inputs", 0, "default"],
  "msg": "Input should be a valid string",
  "input": true
}]}

InputSpec.default is string | null on the backend. A number or a boolean
there is refused with a 422 — the DAG is fine, one field has the wrong type, and
that is a one-call fix for whoever is holding the pipeline.

What changed

requestFailureMessage(response, fallback) reads what the server said and adds
it to what we were doing:

Failed to create pipeline run (422 Unprocessable Entity): root_task.componentRef.spec.inputs.0.default: Input should be a valid string (got true)

It handles a FastAPI detail array (field path, message, and the offending
value), a plain-string detail, a message field, a non-JSON body, and an
empty one — which still reports the status rather than nothing. Several rejected
fields are listed up to three, and a large rejected value is truncated so one
runaway string cannot bury the rest.

Only createPipelineRun is wired up here: it is the call that bit, and the one
an agent drives. The other callers in this service already go through
fetchWithErrorHandling.

Testing

Full suite green — 318 files, 3235 passed. The formatter's tests are built from
the real response body above, captured from the local backend.

Verified end to end against that backend: submitting a spec with a numeric input
default through createPipelineRun now throws a message naming
inputs.0.default, the rule it broke, and the value it was given.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 09-23-fix_say_why_the_backend_refused_a_run/36fde75

camielvs commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camielvs
camielvs force-pushed the 09-23-feat_let_the_agent_name_the_project_and_session branch from 30b3481 to feba6da Compare September 23, 2026 20:57
@camielvs
camielvs force-pushed the 09-23-fix_say_why_the_backend_refused_a_run branch from ab131c4 to 65c7fbe Compare September 23, 2026 20:57
@camielvs
camielvs changed the base branch from 09-23-feat_let_the_agent_name_the_project_and_session to graphite-base/2794 September 23, 2026 21:54
@camielvs
camielvs force-pushed the 09-23-fix_say_why_the_backend_refused_a_run branch from 65c7fbe to 5964134 Compare September 23, 2026 21:55
@camielvs
camielvs changed the base branch from graphite-base/2794 to 09-23-feat_let_the_agent_name_the_project_and_session September 23, 2026 21:55
A rejected submission explains itself — a 422 names the field it would not
accept and the value it was given — and all of it was dropped for the fixed
sentence "Failed to create pipeline run". An agent that reads only that
cannot tell a spec it could correct from a bug it should give up on, and
retries the identical request instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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