Skip to content

fix(server): let the CLI answer workflow questions by their exact name - #41260

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-workflow-exact-wait-name
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-workflow-exact-wait-name

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When t3 workflow questions lists a question whose name starts or ends with a space and I answer it with t3 workflow signal --wait '<that name>', the CLI says Kept until a run waits for it. and the question stays open instead of the answer being delivered.

Change

The t3_workflow tool decoded wait with TrimmedNonEmptyString, so review became review before the store's exact-name lookup. wait now keeps the name as sent and still rejects a blank one. The advertised tool schema is unchanged.

Scope

Bug fix: a question that t3 workflow questions lists cannot be answered by the name it lists. It is a one-schema fix with a standalone repro below, so it needs no issue.

Verification

Linux repro: save as repro.sh and run bash repro.sh from a checkout with dependencies installed and jq (no account or provider needed)
cli=$PWD/apps/server/src/bin.ts; t3() { node "$cli" "$@"; }
scratch=$(mktemp -d); export T3CODE_HOME=$scratch/state T3CODE_WORKFLOWS=$scratch/workflows
mkdir -p "$T3CODE_HOME/userdata" "$T3CODE_WORKFLOWS" "$scratch/project"
echo '{"workflowsEnabled":true}' > "$T3CODE_HOME/userdata/settings.json"
cat > "$T3CODE_WORKFLOWS/questions.ts" <<'TS'
export default T3.workflow("padded", {version: 1, payload: Schema.Struct({})},
  Effect.fn(function* () {
    yield* T3.ask("review ", {title: "Proceed?", choices: ["yes", "no"]});
    return "done";
  }));
TS
node "$cli" serve --port 15345 --no-browser "$scratch/project" > "$scratch/server.log" 2>&1 & server=$!
trap 'kill "$server"' EXIT
ready=$T3CODE_HOME/userdata/server-runtime.json
for _ in $(seq 60); do [ -f "$ready" ] && break; sleep 1; done
[ -f "$ready" ] || { cat "$scratch/server.log"; exit 1; }
rid=$(t3 workflow start padded --key padded-one --json | jq -r .run.runId); sleep 2
t3 workflow questions --json | jq -c 'map(.name)'
t3 workflow signal '{"choice":"yes"}' --run "$rid" --wait 'review '; sleep 2
t3 workflow questions --json | jq -c 'map(.name)'
t3 workflow show "$rid" --json | jq -c '[.run.status, .run.result]'

Setup: Ubuntu 26.04, Node 26.13.1, real t3 serve, fresh isolated state on each commit.
Steps: start padded → list questions → signal --wait 'review ' → list questions → show the run.

887e3a5 (base):

$ rid=$(t3 workflow start padded --key padded-one --json | jq -r .run.runId)
$ t3 workflow questions --json | jq -c 'map(.name)'
["review "]
$ t3 workflow signal '{"choice":"yes"}' --run "$rid" --wait 'review '
Kept until a run waits for it.
$ t3 workflow questions --json | jq -c 'map(.name)'
["review "]
$ t3 workflow show "$rid" --json | jq -c '[.run.status, .run.result]'
["waiting",null]

45d79b2 (fix):

$ rid=$(t3 workflow start padded --key padded-one --json | jq -r .run.runId)
$ t3 workflow questions --json | jq -c 'map(.name)'
["review "]
$ t3 workflow signal '{"choice":"yes"}' --run "$rid" --wait 'review '
Delivered.
$ t3 workflow questions --json | jq -c 'map(.name)'
[]
$ t3 workflow show "$rid" --json | jq -c '[.run.status, .run.result]'
["completed","done"]

The same run keeps the signal on main 12f19b8 and delivers it on 12f19b8 merged locally with 45d79b2. An AI agent ran every check: the new test in tools.test.ts fails on 887e3a5 (expected 'review' to be 'review ') and passes on 45d79b2, and vp run check:changed passes.

Links: regression test

Not shown

  • macOS and Windows. The fix is a schema decode with no platform-specific code.

Generated with Claude Opus 5.5 in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 45d79b2 and b11fc57.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The optional workflow signal wait parameter now preserves surrounding spaces and rejects whitespace-only values. A test covers both behaviors.

Changes: Workflow signal wait validation

Layer / File(s) Summary
Wait parameter validation
apps/server/src/mcp/toolkits/workflow/tools.ts, apps/server/src/mcp/toolkits/workflow/tools.test.ts
The schema rejects strings that are blank after trimming while preserving the original value. The test checks a trailing space and a whitespace-only value.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review 45d79

Workflow signals using a wait name with surrounding spaces now match the listed name exactly, and blank values are still rejected. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the server fix and its effect: the CLI can answer workflow questions by their exact name. It matches the change, which makes the wait parameter keep leading and trailing spaces instead…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem and change are clear. The scope explains why no issue is needed. Verification gives a standa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the server fix and its effect: the CLI can answer workflow questions by their exact name. It matches the change, which makes the wait parameter keep leading and trailing spaces instead of trimming them. It is a conventional commit title in plain language.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem and change are clear. The scope explains why no issue is needed. Verification gives a standalone repro, before and after output, and the test result. It also states what was not checked (macOS and Windows). The description does not include the 'If you used an agent' model line in the expected form, but it does name the model at the end, so the required content is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1f13db5 and 45d79b2.

Files selected for processing: 2

  • apps/server/src/mcp/toolkits/workflow/tools.test.ts
  • apps/server/src/mcp/toolkits/workflow/tools.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Register a workflow that asks review (trailing space), start it, list questions, answer using --wait 'review ', then list questions and inspect the run. Both sides ran real Linux servers and CLI processes against fresh isolated databases using the same driver.

Before After
c5095e7708 b11fc57f30
Before: answer buffered, question retained, run waiting After: answer delivered, questions empty, run completed with done
Before transcript replay After transcript replay
Raw before output Raw after output

Images and videos render recorded CLI output, rather than desktop screen recordings. Reproduction driver, workflow seed, renderer, before timing data, after timing data.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 52b9b77 into pingdotgg:main Nov 23, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants