November 7, 2026
1 pull request merged across 1 repo
bahdotsh/wrkflw
I ran wrkflw the way a coding agent does: through the JSON CLI and the MCP server, on a probe repo. These are the problems that turned up, and how this PR fixes each one.
Problems found
1. False passes on OS matrices. In a matrix over [ubuntu-latest, macos-latest, windows-latest], a step gated on runner.os == 'Windows' that runs exit 1 was reported as success on every leg, in both the CLI and MCP output. Locally those labels run as Linux (or as the host under emulation), so that step never ran. Nothing said so.
2. gate sent agents to the wrong run. gate --format json printed text. The recovery AGENTS.md documented, runs failure latest, reads the newest run. That's whichever workflow the gate ran last, which can be one that passed, so the agent got failures: [] after a failed gate.
3. The MCP server had no fast path. There was no gate tool, and run_workflow couldn't reuse earlier passing results. MCP job results also dropped repeated_from.
4. No live output. In JSON mode a step's output only arrived when the step ended, so an agent couldn't tell a slow step from a hung one.
5. Nothing flagged before a run. plan didn't warn that some jobs would run as a different OS.
Commits
feat(executor): flag jobs that ran as another OS thanruns-onasked. The engine compares the OS thatruns-onnames with therunner.osthe job actually saw. On a mismatch it logs a warning, addsrunner: {requested, ran_as}tojob_finishedand torun_finished.jobs, and adds the job to a newrun_finished.unverifiedarray. This also covers matrix legs folded into another leg and jobs whose earlier pass was reused. It skips jobs withcontainer:, labels mapped with--platform, and labels that name no OS.run_finished.jobsnow also carriesrepeated_from.feat(gate): print one JSON object with--format json, and add it to MCP. Thegateobject haspassed,failed,unverified,uncommitted_changes, and for each workflow itsstatus,run_id,jobsand failure digest. There's a new MCPgatetool, andrun_workflowtakesreuse_results.feat(run): stream step output as NDJSON with--stream-output. Opt-instep_outputlines,{job, step, index, lines}, masked like the rest of the output. It's opt-in becausestep_finishedalready carries the full output, so streaming by default would make agents read everything twice.feat(plan): list jobs that would run as another OS.plan --runtime(defaultauto, resolved the same wayrunresolves it) reports the sameunverifiedentries for each matrix leg. MCPplan_workflowtakesruntimetoo. On this repo's ownci.yml, it flags the macOS and Windows build legs.feat(ui): mark jobs that ran as another OS in the run story. The job's line shows⚠ ran as Linux (windows-latest)next to its result.
AGENTS.md and README are updated in the same commits as the behaviour they describe.
What I deliberately did *not* change
An unverified job keeps status success and exit code 0. Failing it would break every workflow with an OS matrix. If we want a hard failure, that belongs behind a flag such as --strict-runners in a follow-up.
Verification
- Each commit was built and checked on its own:
cargo clippy --workspace --all-features --all-targets -D warningsis clean andcargo test --workspace --all-featurespasses. - New tests:
- the OS check itself;
unverifiedinrun_finished;- the gate report, including a child that crashes and a child that claims success but exits non-zero;
- the MCP
gateandreuse_resultsarguments; - an integration test that streamed lines arrive before
step_finishedand contain no secrets; - an integration test for
plan'sunverifiedwith--runtime docker; - a TUI render test for the badge, including at narrow widths.
- Manual runs on a probe repo:
- Docker, emulation and
--reuse-resultsruns all list the Windows and macOS legs as unverified. gate --format jsonexits 1 and returns the failing workflow's run id and failure digest. The MCPgatetool returns the same.- With
--stream-outputunder Docker, step lines arrived about a second apart while the step was still running.
Follow-ups from review
fix(mcp): pass the server's own signals on to its tool calls. Each tool call runs in its own process group, so terminal Ctrl+C and hangup no longer reached it. The server now interrupts every live tool call's group on SIGINT, SIGTERM or SIGHUP, waits the usual grace period, and only then exits.refactor(executor): judge runs-on from the labels that pick the image. The engine and the runner check now share one label expansion and--platformlookup. Run records store the executor'sRunnerSubstitutiondirectly; the JSON is unchanged. A reused matrix leg that matches no leg now logs a warning instead of silently counting as verified, and the reused OS-matrix path has an integration test.perf(plan): only probe for Docker when the answer changes something.plan --runtime autoskips the Docker/Podman probe on Linux hosts and when no job names an OS.fix(gate): pass each workflow's run_finished through whole, so newrun_finishedfields reach the gate. Adds a test forgate --install-hook --format json.fix(run): refuse --stream-output without --format json instead of silently ignoring it.fix(runs): record a run stopped by a signal as interrupted. A group-wide SIGINT also kills the step, so the run could be recorded asfailureif the engine finished before the handler exited. macOS CI caught this. The handler now marks the process interrupted first, andrun_finishedfor an interrupted run has exit code 1.