Skip to content

Test Workshop against a real Gateway, its window, and two Pack joins - #32

Merged
rogers-andrew merged 9 commits into
cppalliance:masterfrom
rogers-andrew:qa-plan-tests
Nov 25, 2026
Merged

rogers-andrew merged 9 commits into
cppalliance:masterfrom
rogers-andrew:qa-plan-tests

Conversation

@rogers-andrew

@rogers-andrew rogers-andrew commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request adds twelve tests to workshop-server, the crate that holds Workshop's server. It touches seven test files, one script and one CI job that run the live tests, and the plan, the document that states what the change does and how it was checked.

Of the twelve, two run in every normal test run. I wrote each of the two against a break, which is a deliberate fault put into the code that sets up Workshop's Packs. The existing tests gave the same results with the break in place as without it, and the new test fails. The other ten are live tests: they run Workshop against a real Gateway, through Workshop's server, through the Workshop program, and through Workshop's window. They are marked #[ignore], so a normal test run skips them. One command runs all ten, and CI runs that command on every pull request. The chat model behind the Gateway is CheapSeek, a test server that speaks the OpenAI chat API and computes each reply from fixed rules.

The live runs also showed that Workshop could not start a Gateway built from the Gateway repository's master at commit 52fd92d: that Gateway exited after it had waited ten seconds for a lock that Workshop held. Separately, one existing test of workshop-server, stalled_browser_cleanup_is_bounded_after_gateway_disconnect, fails on Linux on unchanged code.

Terms

  • Agent: a prompt that Workshop is running.
  • Agents socket: the /agents/ws WebSocket of Workshop's server. A client such as Workshop's page launches an agent and reads its replies over it.
  • MCP server: a server that offers tools to a model over the Model Context Protocol. A person lists the MCP servers for Workshop in an mcp.json file.
  • mcp Pack and web Pack: the mcp Pack gives prompts the tools of the MCP servers. The web Pack gives prompts web search, and it sends each search to a Gateway.
  • Stand-in Gateway: a small test server that answers as a Gateway would.
  • Break: a deliberate fault that I put into the code to see whether any test fails.
  • Live test: a test that needs a real Gateway. It is marked #[ignore], so a normal test run skips it.
  • MCP test and web search test: the two new tests that always run.
  • Socket tests: the six live tests that launch agents over the agents socket. One of them is the chat test.
  • Kill test, program test, typing test, and closing test: the other four live tests, each named for what it does.
  • Workshop program: the desktop application as a person starts it, with its window. The socket tests and the kill test run only Workshop's server, inside the test.
  • CheapSeek: a test server that speaks the OpenAI chat API and computes each reply from fixed rules.
  • Qwen3 0.6B: the small local model that the live tests ran on before 2026-11-23.
  • say directive: text in a message that makes CheapSeek send back the text the directive holds.
  • Remote endpoint: how the Gateway's settings describe a model server that the Gateway calls over HTTP.
  • Declared context: the context size, in tokens, that the Gateway's settings state for a model.
  • Model role: a name, such as strong, by which a prompt asks for a kind of model.
  • Model picker: the control in Workshop's window that shows the current model.
  • Discovery file: the file a running Gateway writes so that other programs can find it.
  • Launch lock: a lock that Workshop takes before it starts a Gateway.
  • Plan: the document, committed with the change, that states what the change does and how it was checked.

The two tests that always run check what Workshop gives its mcp and web Packs

Test File
the_servers_of_the_configured_mcp_file_reach_the_mcp_pack crates/workshop/server/src/agents/tests.rs
a_prompts_web_search_asks_the_gateway_registered_when_the_search_starts crates/workshop/server/src/agents/tests-gateway.rs

Each of the two tests fails under a break that the existing tests let pass. A break is a deliberate fault that I put into the code to see whether any test fails. Under each of these two breaks, the existing tests gave the same results as on unchanged code, which showed that they did not check what the break changed. I reverted each break after its run.

Workshop must hand the configured MCP servers to the mcp Pack. An agent is a prompt that Workshop is running. An agent can get tools from MCP servers, which are servers that offer tools to a model over the Model Context Protocol. A person lists those servers in an mcp.json file, and the mcp Pack makes their tools available to prompts. server_host, the function in crates/workshop/server/src/agents.rs that sets up Workshop's Packs, reads the file and hands its servers to the mcp Pack in one line. For the break, I changed that line to hand over an empty object. A Workshop with configured MCP servers then ran without them. The new test, the MCP test, writes an mcp.json that names two servers, sets up the Packs, and checks that the mcp Pack lists both servers.

Each web search must go to the Gateway that Workshop is using when the search starts. The web Pack sends each web search to a Gateway, and it gets that Gateway from Workshop. Workshop keeps the address and key of its current Gateway in a registry, and another Gateway can replace the current one while Workshop runs. Workshop reads the registry again as each tool call starts, so the next search after a replacement goes to the new Gateway. For the break, I changed the code to read the registry once, when Workshop sets up its Packs. Searches then kept going to the first Gateway after a second one replaced it. The new test, the web search test, uses two stand-in Gateways, which are small test servers that answer a search as a Gateway would. It sets up the Packs with the first one in the registry, replaces it with the second, runs a prompt that searches, and checks that the second one answered.

The plan has a third break, in which Workshop never gives the web Pack a Gateway. The web search test fails under it, and so does the existing test a_message_sent_while_a_tool_call_runs_is_a_user_message_the_next_request_holds.

The ten live tests run Workshop against a real Gateway

Name Tests File Runs on
Socket tests 6 crates/workshop/server/tests/it/live.rs Every OS
Kill test 1 crates/workshop/server/tests/it/live_stop.rs Unix
Program test 1 crates/workshop/server/tests/it/live_program.rs Linux
Typing test and closing test 2 crates/workshop/server/tests/it/live_window.rs Linux

Besides these four files and the two files of the MCP test and the web search test, this pull request touches crates/workshop/server/tests/it/main.rs, which declares the four new modules.

Socket tests. A client such as Workshop's page launches an agent and reads its replies over the agents socket, which is the /agents/ws WebSocket of Workshop's server. Each of the six tests runs Workshop's server inside the test, points it at a running Gateway, launches one agent over the agents socket, and reads what a client would read. In five of the tests the agent is a different kind of prompt each time:

  • the shipped hello.md;
  • a chat that recalls a name from an earlier message (the chat test);
  • a prompt that uses two model roles, which are names such as strong by which a prompt asks for a kind of model;
  • a prompt whose model calls a tool, where the test reads the call, then the tool's result, then a reply;
  • a larger prompt that has an argument with a default, uses the store, calls a tool from its Lua code, and starts two tasks.

The sixth test checks keys. With the Gateway set to require a key from every caller, a chat request sent without a key is refused with status 401, and Workshop's own run, which sends its key, still ends with a reply that is not empty.

Kill test. This test checks what Workshop does when the Gateway dies while a reply is streaming. It starts a Gateway, launches an agent whose reply is long enough to be cut off part way, and kills every process of the Gateway once the reply has started. It then checks three things: the client is told that the request to the model failed, Workshop's run log records the run as ended with an error, and Workshop still answers a new connection and a new launch.

Program test. This test starts the Workshop program beside a Gateway that is already running. It checks that the program finds that Gateway and reports its address, and that a chat with Workshop's built-in chat agent gets a reply. This test, the typing test, and the closing test refuse a Workshop program that has a workshop.toml beside it, because Workshop reads that file before the workshop.toml that the test writes.

Typing test and closing test. These two tests drive Workshop's real window through tauri-driver, Tauri's WebDriver server. The typing test types a message in the chat box and reads the reply in the chat panel. The closing test has Workshop start a Gateway and closes the window with the Close button of the title bar that Workshop draws. Closing the window is meant to leave that Gateway running, so the test then checks that the Gateway still answers a chat request.

The doc comment at the top of each of the four files gives the environment variables its tests read and the command that runs them. The program test and the two window tests start Workshop on a display of its own (xvfb-run) and a message bus of its own (dbus-run-session), so the window stays off the screen of the person who runs the tests.

One command runs the ten live tests, and CI runs it on every pull request

node tools/live-tests.mjs runs all ten on Linux, once cargo workshop has built the Workshop program and placed the pinned Gateway beside it. The script reads the address of a running CheapSeek from CHEAPSEEK_BASE_URL. It makes a temporary home folder whose Gateway config serves CheapSeek on a free loopback port. It starts the Gateway and runs the six socket tests, the program test, and the typing test. It then stops the Gateway and runs the kill test and the closing test, each of which starts a Gateway itself.

The new job live of ci.yml runs the same command on ubuntu-22.04. It stages the Gateway release that gateway-pin/pin.json names, builds Workshop with cargo workshop, installs tauri-driver, and starts CheapSeek with CheapSeek's own action. ci-green, the check that branch protection requires, lists the job.

On my machine the script passed 13 runs of 13 on 2026-11-25, in 13.0 to 22.6 seconds a run. In CI the job live passed in its first run the same day: all ten tests passed, and the job took 8 minutes, of which 4 were the build of Workshop.

With CheapSeek behind the Gateway, each live test passed every run

Before a live test runs, a person starts CheapSeek and adds it to the Gateway's settings as a remote endpoint with one chat model. The settings declare a context of 32,768 tokens for that model. CheapSeek's wording can change between its releases, so each test checks a property of the reply and never its exact words. For example, a test checks that the reply is not empty, that it contains a name given earlier, or that it follows a tool call.

I made the runs on 2026-11-24, with CheapSeek release 1.1.0 and the current test code. The Gateway was built from cppalliance/runvil-gateway at commit 52fd92d, with two exceptions. In the closing test Workshop starts the Gateway itself, and it started the Gateway release that Workshop is pinned to, gateway-v0.3.1. The kill test ran with both Gateways.

Test Runs passed Seconds per run
All six socket tests, one after another 10 of 10 2.2 to 4.4 for all six; 11.2 and 15.5 in two runs
All six socket tests at the same time 10 of 10 0.6 to 1.2 for all six
Program test 10 of 10 0.9 to 1.1
Typing test 25 of 25 3.1 to 3.8
Kill test, Gateway built from source 50 of 50 1.0 to 1.6
Kill test, Gateway release gateway-v0.3.1 50 of 50 1.0 to 1.8; 7.4 in one run
Closing test 25 of 25 2.5 to 3.2; 8.2 in one run

Changes since review was requested: CheapSeek, six corrections, a rebase, and a CI job for the live tests

2026-11-25: a CI job for the live tests, and a rebase. Andrew Wheeler's review asked for the live tests to run automatically, so I added tools/live-tests.mjs and the job live. The script's first run showed one more thing that the closing test needs. In a home folder where no profile is selected, the Gateway that Workshop starts serves CheapSeek, and Workshop's model picker stays empty, so the closing test failed after 120 seconds. The script now writes the file that selects the profile, and the doc comment of live_window.rs says that the test needs it. The rest of the test code is as it was.

On the same day I rebased the branch onto three new commits of master, which pin a Harness that streams a reply to the Host. Upstream changed agents/tests.rs for it, and I put the MCP test into the new version of that file as it was. The test counts and the results of the three breaks came out the same as on the base before.

2026-11-23: the live tests moved from Qwen3 0.6B to CheapSeek. Before the move, the live tests ran on Qwen3 0.6B, a small model that the Gateway loaded and ran itself. On that model the six socket tests took 22 to 25 seconds, and the kill test took about 5 seconds. With CheapSeek they take 2.2 to 4.4 seconds and 1.0 to 1.8 seconds.

Of the ten live tests, seven work with CheapSeek as they were written. Three changed, in live.rs, live_stop.rs, and live_window.rs:

  • The chat test now tells the agent a name and asks for it back. Before, it used an arbitrary word, "tangerine". CheapSeek's rules remember a name from an earlier turn, and they do not remember an arbitrary word.
  • The kill test now scripts the reply that it cuts off. Its message is a say directive that holds 100,000 dots, so CheapSeek sends the dots back. CheapSeek sends its whole reply to an ordinary request at once, so such a reply is over before the test can kill the Gateway.
  • The closing test now waits until the model picker in Workshop's window shows the Gateway's model before it clicks Close, because Workshop ignored a click made while its page was still loading.

2026-11-24: six corrections to the live tests. GitHub Copilot's review of this pull request found these faults in the live tests, and I corrected each one.

  • The program test, the typing test, and the closing test now refuse a Workshop program that has a workshop.toml beside it. Workshop reads that file before the workshop.toml that the test writes, and keeps its state beside the file it reads. The tests would have run on a person's own settings.
  • The socket test of a tool call now requires the tool call, then the tool's result, then a reply. Before, it passed when a reply followed a call that lacked a result.
  • The WebDriver client of the typing test and the closing test now treats a command that the driver refuses as an error. Before, it read the driver's reason as a result. With a selector for an element that is not on the page, the closing test now fails after 4 seconds with the reason "no such element".
  • The kill test, the typing test, and the closing test now wait for the first model in the Gateway's list that can serve a chat, which is the rule Workshop's own model picker follows. Before, they took the first model of any kind.
  • The last chat request of the closing test now has the same time limit as the test's other waits.
  • The cleanup code of the kill test now kills the Gateway's process group even when the Gateway's supervisor process has already exited.

The MCP test and the web search test are the same as they were when review was requested. For anyone who read the earlier commits: I rebuilt the branch on both days, so its commits are new. On 2026-11-24 the content changed in the first commit, which adds the plan, in the four commits that add live.rs, live_stop.rs, live_program.rs, and live_window.rs, and in the last commit, which adds the results to the plan.

The live runs showed a lost click, a Gateway that Workshop could not start, and one test that fails on unchanged code

  • Workshop ignored a click on Close while its page was still loading. The closing test used to click Close as soon as the Gateway answered a chat request. With Qwen3 0.6B that was about six seconds after Workshop started, because the Gateway loaded the model first. With CheapSeek it is about a second, and the test began to fail. I made three runs to look at this. In one of them the page was still loading when the test clicked (document.readyState was interactive, which means the page had not finished loading), the window stayed open, and a second click two seconds later closed it. I recorded this as a fault in the test, and the test now waits for the model picker before it clicks.
  • Workshop could not start a Gateway built from the Gateway repository's master. I found this with the Gateway at commit 52fd92d and Workshop's master at commit 68c7249 of 2026-11-20, an earlier base of this branch (four rebases ago). I have not tried it again since. Workshop takes a lock, the launch lock, before it starts a Gateway, and it holds the lock until that Gateway has written its discovery file. The discovery file is the file a running Gateway writes so that other programs can find it. The Gateway built from master tries to take the same lock when it starts. It waits ten seconds and exits, and Workshop reports "the launched gateway exited (exit status: 1) without writing a gateway discovery file". Workshop can start the Gateway release it is pinned to.
  • One existing test fails on Linux on unchanged code. The test is stalled_browser_cleanup_is_bounded_after_gateway_disconnect, in crates/workshop/server/tests/it/realtime_relay/overload.rs. On my Linux machine it fails after about ten seconds, at the step that the test names the Gateway fills the relay's browser send. It fails on this branch, and it fails the same way on unchanged master at f40a4fce, the base just before the current one. That test and the code it tests are the same on this branch as on master. CI runs the server's tests on Windows only, and CI passes.
  • The Gateway program that a person starts is a supervisor. It starts a second process, and that second process serves the requests. When the supervisor alone is killed, the serving process goes on for about 0.6 seconds and then shuts down cleanly. A reply shorter than that finishes, and then the run ends without an error and the kill test fails. A longer reply is cut off either way. The kill test therefore kills the whole process group, which holds every process of the Gateway, so that the reply is always cut off.
  • The Engine refuses a request that is larger than the model's declared context, before the request is sent. This is why the kill test's scripted reply is made of dots. CheapSeek counts each dot as one token, and the Engine counts four characters to a token. The kill test uses that difference. By the Engine's count, a request of 100,000 dots is about 25,000 tokens, which fits the declared context of 32,768. CheapSeek still streams the reply in 100,000 pieces.

I have not filed issues for any of these.

In the normal run 342 of 343 tests pass, and the one failure also occurs on unchanged code

I measured the test counts and the results of the breaks on this branch, which was rebased onto master at commit 1b33d9f8 on 2026-11-25.

  • cargo nextest run --locked -p workshop -p workshop-server -p workshop-server-api ran 343 tests and skipped 14 more. Of the 343, 342 passed. The one failure is stalled_browser_cleanup_is_bounded_after_gateway_disconnect, which also fails on unchanged master. The 14 skipped tests are the ten live tests and four others that were skipped before this change.
  • cargo nextest run --locked --workspace --exclude workshop --exclude workshop-server --exclude workshop-server-api --all-features ran 704 tests, and all of them passed. It skipped 1.
  • Each of the three breaks in the plan still makes its test fail: the MCP test under the first break, and the web search test under the second and the third.
  • These commands passed: cargo clippy -p workshop -p workshop-server -p workshop-server-api --all-targets, cargo fmt --all --check, cargo test -p build-xtask, and the check of the repository's rules for its defined terms, node --test crates/workshop/ui/test/docs-claims.mjs.
  • On my machine I skipped three checks: clippy over the rest of the workspace, the docs build, and the custom lints. CI runs all three, in its clippy, docs, and dylint checks. All of CI's checks, live among them, pass on this branch.

The plan lists the breaks and records every result

plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md lists the three breaks and records every result. Anyone who saw this pull request before 2026-11-21 saw six plans, which were merged into this one that day.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9381ba61-63b6-4034-8293-35a3ac67e606
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@rogers-andrew
rogers-andrew force-pushed the qa-plan-tests branch 3 times, most recently from bb354be to 1368f4b Compare November 23, 2026 15:29
@rogers-andrew
rogers-andrew marked this pull request as ready for review November 23, 2026 17:38
Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:38

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The live-test helpers can select non-chat models, mistake WebDriver errors for successful results, and leave descendant processes running after teardown.

3 open issues
What changed in this PR

Adds test coverage for Workshop’s Pack configuration and its integration with a real Gateway, model, and desktop window. No production code changes.

Changes:

  • Adds two default-run regression tests for MCP configuration and per-call Gateway lookup.
  • Adds ten opt-in live tests covering agent runs, authentication, Gateway failure, program discovery, and window behavior.
  • Documents test setup, platform requirements, and verification results.
File Description
plan/​2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md Records scope, test design, and verification results.
crates/​workshop/​server/​tests/​it/​main.rs Registers live-test modules with platform gates.
crates/​workshop/​server/​tests/​it/​live.rs Adds six real-Gateway agent socket tests.
crates/​workshop/​server/​tests/​it/​live_window.rs Adds window typing and close-behavior tests.
crates/​workshop/​server/​tests/​it/​live_stop.rs Tests interrupted streaming and continued server operation.
crates/​workshop/​server/​tests/​it/​live_program.rs Tests Gateway discovery and chat through the Workshop program.
crates/​workshop/​server/​src/​agents/​tests.rs Checks configured MCP servers reach the Pack.
crates/​workshop/​server/​src/​agents/​tests-gateway.rs Checks web searches use the currently registered Gateway.

Review effort: Balanced

Comment on lines +71 to +72
if matches!(self.0.try_wait(), Ok(Some(_))) {
return;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 41d7d0d. The guard now kills the process group before it reaps the program, whether or not the program has already exited, and a flag stops a second call.

.json()
.await
.ok()?;
let model = listed["data"][0]["id"].as_str()?.to_owned();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 41d7d0d and 5f3cccc. Both places now take the first model that workshop_menu::is_chat_capable accepts, through one helper, first_chat_model.

Comment on lines +198 to +199
.await?
.json()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5f3cccc. command now returns an error when the driver answers with an error status, with the driver's reason in the message. I checked it with a selector for an element that is not on the page: the closing test failed after 4 seconds with "no such element".

Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The live tests can load an executable-adjacent configuration and modify unrelated Workshop state, while model-selection, process-cleanup, and timeout defects can also cause failures or hangs.

6 open issues

Review effort: Balanced

/// listens on, so a Gateway the program uses can only be one it found
/// through a discovery file or started itself.
pub(crate) fn settings_folder() -> tempfile::TempDir {
let folder = tempfile::TempDir::new().expect("tempdir");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a727947. workshop_program now refuses a program that has a workshop.toml beside it, so the program test and both window tests stop before the program starts. I checked it by putting a file there: the program test and the typing test both refused, and the program test passed again once the file was gone.

.await;
if let Ok(listed) = listed
&& let Ok(body) = listed.json::<serde_json::Value>().await
&& let Some(model) = body["data"][0]["id"].as_str()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 41d7d0d. The readiness check now takes the first chat-capable model, through first_chat_model.

.expect("Workshop stops serving its page once its window is closed");

assert!(
answering_model(&base_url, &key).await.is_some(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5f3cccc. The chat request in answering_model now has the limit STEP, so the last probe ends within that limit and the test's cleanup runs.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread crates/workshop/server/tests/it/live.rs Outdated
Comment on lines +314 to +319
let called = kinds.iter().position(|kind| kind.starts_with("tool_call"));
let replied = kinds.iter().rposition(|kind| *kind == "agent_message");
assert!(
called.is_some() && called < replied,
"the model calls the tool, and a reply follows the call: {kinds:?}"
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cce2132. The test now requires tool_call, then tool_call_update, then the last agent_message. It passed 20 runs of 20 on CheapSeek.

Comment on lines +145 to +146
std::env::var("RUNVIL_E2E_WORKSHOP_BIN")
.expect("RUNVIL_E2E_WORKSHOP_BIN is the Workshop program to start")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a727947. workshop_program now refuses a program that has a workshop.toml beside it, and the comment on the settings folder gives Workshop's search order.

Comment on lines +198 to +199
.send()
.await?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5f3cccc. command now checks the HTTP status, so a refused command is an error and the expect on each typing command catches it.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Comment thread crates/workshop/server/tests/it/live.rs Resolved
rogers-andrew and others added 5 commits November 25, 2026 08:32
Two joins in the code that builds Workshop's Host can be broken while every test passes: the one that hands the mcp Pack its configured servers, and the one that lends a web search the Gateway registered when the search starts. And nothing runs Workshop against a real Gateway. The plan adds two tests that run in a normal test run, with the three breaks that must fail them, and ten that are ignored unless asked for. Those ten run against a real Gateway whose chat model is CheapSeek, a test server that answers by rule.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`server_host` reads the servers of the configured `mcp.json` and hands them to the mcp Pack. With an empty object handed over in their place, every test passed. One test now builds the Host from a file that names two servers and reads the Pack's listing of them. No production code changes.

- `the_servers_of_the_configured_mcp_file_reach_the_mcp_pack`: a prompt that requires the mcp Pack and lists its servers returns `docs,search`, the two the file names.
- The servers point at a loopback port where nothing listens, so the test starts no server. The listing names a server whatever its status.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`a_prompts_web_search_asks_the_gateway_registered_when_the_search_starts` builds Workshop's Host under one stand-in Gateway, replaces it with a second, and runs a prompt whose script calls `web/search` through the web library. The answer must hold the second Gateway's results, under the second Gateway's key, marked as untrusted. No production code changes.

The key check of the file's stand-in Gateways is now one helper, `carries`.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Six tests bind Workshop's router to the Gateway that `RUNVIL_E2E_GATEWAY` names, launch an agent over the agents socket, and read the frames a client reads. Each is ignored unless asked for, because it needs a running Gateway that serves a chat model. The model they are run on is CheapSeek, a test server that answers by rule, which the Gateway reaches as a remote endpoint. No production code changes.

- The shipped hello prompt ends with text.
- The built-in chat agent recalls a name from an earlier message.
- A prompt that drafts under `creative` and critiques under `strong` gets two replies.
- A model calls a tool the prompt offers, the tool's result follows, and the round after it replies.
- A larger prompt with an argument, the store, a tool, and a fanout of two tasks gets three replies.
- A request with no key is answered 401, and Workshop's own run still ends with text.

The tests share one Gateway, so they are run one at a time with `-j 1`.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One test starts the Gateway program that `RUNVIL_E2E_GATEWAY_BIN` names, launches an agent whose reply is 100,000 pieces long, and kills every process of the Gateway once the reply has started. It is ignored unless asked for, it refuses to start when a Gateway already answers at the address, and the module is built on Unix only. No production code changes.

- The client reads an error frame that says the model turn failed.
- The run log records the run as ended with an error.
- Workshop still lists its agents and acknowledges a launch, and says the model catalog could not be fetched.

The reply is scripted. The agent's one message is a `say` directive of 100,000 dots, which CheapSeek sends back one dot to a piece. CheapSeek answers a plain request at once, so no other reply is still in flight when the kill lands.

The Gateway is killed, not asked to stop: its `POST /shutdown` lets a reply in flight finish, so a run sees no failure from it. The kill goes to a process group, because the program the test starts only supervises the process that serves: with the supervisor alone killed, the serving process shuts down in good order, and a short reply finishes first. Four helpers of the `live` module become visible to the test crate so this module can use them.

The test waits for the first model of the Gateway's list that can serve a chat, which is the rule Workshop's own model picker follows. The helper for it is visible to the test crate, for the window tests. The guard kills the group even when the program it started has already exited: the group's id stays the program's until the program is reaped.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
rogers-andrew and others added 4 commits November 25, 2026 08:32
One test starts the program that `RUNVIL_E2E_WORKSHOP_BIN` names, with the home folder of a Gateway that is already running, and talks to the program's local server. It is ignored unless asked for, and the module is built on Linux only. No production code changes.

- `GET /gateway/origin` answers the running Gateway's address. The settings file names an address nothing listens on, so the answer can only have come from the Gateway's discovery file.
- The built-in chat agent, launched over the agents socket, replies to one message.

The program is started in a session of its own, on a display that `xvfb-run` makes and a message bus that `dbus-run-session` makes, without `WAYLAND_DISPLAY`. So no window opens on the person's screen, and the program's single-instance check cannot reach a Workshop the person has open. The test kills the whole session when it ends and waits until it is empty.

The test refuses a program that has a `workshop.toml` beside it. Workshop reads that file before the one in the folder it starts in, and keeps its state beside the file it reads, so the test would run on a person's own settings.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two tests start `tauri-driver` on a display and a message bus of their own and have it open the Workshop program's window. They speak WebDriver with the HTTP client the suite already uses. Both are ignored unless asked for, and the module is built on Linux only. No production code changes.

- `a_message_typed_in_the_workshop_window_gets_a_reply_in_the_chat_panel`: with a Gateway running, a message typed in the chat box shows in the chat panel, followed by a reply. The test types once the model picker names the Gateway's model and the chat box's button offers to send, because Workshop ignores Enter until the agent's run has started.
- `closing_workshops_window_leaves_the_gateway_it_started_answering`: with no Gateway running, Workshop starts the one beside it; the test clicks the title bar's Close button, Workshop stops serving, and the Gateway still answers a chat request. The test clicks once the model picker names the Gateway's model, because a click on a page that is still loading does nothing.

The helpers of `live_program.rs` that start a program in a session of its own now take any command, so both modules share them.

A command that the driver refuses is an error in the tests' WebDriver client, with the driver's reason in the message. The tests wait for the first model of the Gateway's list that can serve a chat, and the closing test's last chat request has the same time limit as its other waits.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`tools/live-tests.mjs` runs the ten live tests on Linux. It makes a temporary home folder whose Gateway config serves CheapSeek, a test server that answers chat requests by rule, on a free loopback port. It starts the Gateway that `cargo workshop` placed beside the Workshop program and runs the six socket tests, the program test, and the typing test. It then stops the Gateway and runs the kill test and the closing test, each of which starts a Gateway itself. It also stops its Gateway on a fault of its own, on SIGINT, and on SIGTERM.

The new job `live` of `ci.yml` runs the script on `ubuntu-22.04`: it stages the Gateway release that `gateway-pin/pin.json` names, builds Workshop with `cargo workshop`, installs `tauri-driver`, and starts CheapSeek with CheapSeek's own action. `ci-green` requires the job.

Andrew Wheeler asked for this in review: tests that run only by hand end up not run.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Each of the three breaks fails the test the plan names, on `upstream/master` at `1b33d9f8`. The ten tests that need a real Gateway pass there with CheapSeek as the chat model, 13 runs of 13 through `tools/live-tests.mjs`. The plan also records what the earlier runs on a small local model found, the tests that were corrected after failing some runs, what the runs found about Workshop and the Gateway, the one test that fails on unchanged code, and which checks ran locally and which in CI. It records the six faults that Copilot's review found in the live tests and the runs made after they were corrected, the rebase onto upstream's commits that stream a reply to the Host, and the profile selection that the closing test turned out to need.

Plan: /plan/2026-11-20-1-pack-hand-offs-and-real-gateway.plan.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@awheeler294 awheeler294 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rogers-andrew
rogers-andrew merged commit 1b6a768 into cppalliance:master Nov 25, 2026
18 checks passed
@vinniefalco

Copy link
Copy Markdown
Member

fucking hell there is a lot of noise in these comments and replies... I don't know what to read

@rogers-andrew

Copy link
Copy Markdown
Contributor Author

Save us @wpak-ai, I don't think the scroll bar can get any smaller

@rogers-andrew
rogers-andrew deleted the qa-plan-tests branch November 25, 2026 20:00
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.

4 participants