Skip to content

test(webui): stop three tests depending on the machine and on request order - #15

Merged
UncleMoc merged 1 commit into
mainfrom
fix/ssh-endpoint-test-environment-dependency
Nov 10, 2026
Merged

UncleMoc merged 1 commit into
mainfrom
fix/ssh-endpoint-test-environment-dependency

Conversation

@UncleMoc

Copy link
Copy Markdown
Collaborator

Three WebUI tests read something other than what they claim to read. Two of them
pass on CI and fail on a developer machine; the third passes or fails depending
on which request reaches the model endpoint first.

The SSH test reads the machine's own ~/.ssh/config

ssh-endpoint.test.ts claims that a host named in the config file keeps its
alias. It injected no discovery, so the runtime read the machine's real
~/.ssh/config. On a machine that does not declare textvision.top the host
is absent from the config, the save is refused as host_not_configured, and
the test fails. On a CI machine the file does not exist, the config is
unreadable, the runtime says nothing about the alias — and the test passes for
the wrong reason.

The repository already has the right pattern: ssh-connection-service.test.ts
injects a synthetic discovery and reads without touching the machine's own.
This file was the one that missed it. The expected values do not change; only
what is read.

The two model-stub tests read a race

real-host-skill-catalog.test.ts and real-host-capability-surface.test.ts
read stub.requests[0] as the user's turn. The runtime sends the background
session-title request to the same model endpoint, and it can win the race to
it. Waiting for "at least one request" is satisfied by the title request, so
the assertion could run before the turn's request had been sent at all.

The turn's own stream is now consumed before anything is asserted — the turn
is not over until the runtime has sent it — and the turn request is
identified by the absence of the submit_session_title tool.

How this was checked

Not by "the test is green now":

  • A config file declaring a different alias fails before this change and
    passes after it, on the same machine.
  • Filtering for the title request instead of the turn fails.
  • Dropping the stream consumption fails two times out of three — that step is
    load-bearing, not decoration.
  • The three files pass four consecutive runs; this kind of race needs more
    than one green run to mean anything.

pnpm typecheck:webui, pnpm check:source, pnpm check:tsconfig and the
five WebUI static gates all pass. The full pnpm test:webui suite is green on
this branch.

The upstream repair for the baseline failures that PR #11 fixed landed first;
this branch is rebased onto the merge of PR #10.

… order

The new baseline fails 15 tests on macOS in CI. Three more failed only on a
machine with its own `~/.ssh/config`, and one of the fifteen failed here too
because it read a race rather than a request.

The SSH test claimed that a host named in the config file keeps its alias, but
it injected no discovery, so the runtime read the machine's real
`~/.ssh/config`. On a machine that does not declare `textvision.top` the host
is absent from the config and the save is refused; on a CI machine the file
does not exist, the config is unreadable, and the runtime says nothing about
the alias — so the test passed there by accident. The repository already has
the right pattern: `ssh-connection-service.test.ts` injects a synthetic
discovery and reads without touching the machine's own. This file was the
one that missed it.

The two model-stub tests read `stub.requests[0]` as the user's turn, but the
runtime sends the background session-title request to the same endpoint and it
can win the race. Worse, waiting for "at least one request" is satisfied by
the title request, so the assertion ran before the turn's request had been
sent at all. The turn's own stream is now consumed first — the turn is not
over until the runtime has sent it — and the turn request is identified by
the absence of the `submit_session_title` tool.

The expected values do not change; only what is read, and when.

Verified against the reverse: injecting a config that declares a different
alias fails before this change and passes after it; filtering for the title
request instead of the turn fails; and dropping the stream consumption fails
two times out of three. The three files pass four consecutive runs.

The 15 remaining failures are the ones the baseline already fails in CI, and
the upstream repair for them is in progress at PR #11.
@UncleMoc
UncleMoc merged commit 9a256ee into main Nov 10, 2026
3 checks passed
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