Skip to content

The worker's proposal-run test sets up the pod's whole artifacts host, so its deny run always reaches the approval gate - #1268

Merged
misterjohannesson merged 1 commit into
development-2026-11-28-2from
fix/worker-proposal-run-test-race
Nov 28, 2026
Merged

misterjohannesson merged 1 commit into
development-2026-11-28-2from
fix/worker-proposal-run-test-race

Conversation

@misterjohannesson

Copy link
Copy Markdown
Contributor

The worker's ProposalRunTest test "the same run without them is denied at the publish" failed once in the root mix check on the chunk head d711e6c (Result: 360/361 passed): the replay held a turn_ended and no approval_decided. The cause is in the test. The product's event order is fine, and #1265 is not involved.

What was there

The setup installed only the publish function (Troupe.Artifacts.install/1). Before the gate asks anyone about a new version, it asks the host what the plane says of it (PublishArtifact.publication/2 calls Troupe.Artifacts.about/2), and that question went to whatever about the VM held. In the umbrella run the gateway suite runs first, in the same VM, and leaves the daemon's host installed. Its Troupe.Gateway.Artifacts.about/2 calls Troupe.Gateway.Plane, and that process does not run in the worker suite. The failing run's own log shows this:

** (stop) exited in: GenServer.call(Troupe.Gateway.Plane, :url, 5000)
    ** (EXIT) no process: ...
    (troupe_gateway 0.50.0-beta) lib/troupe/gateway/artifacts.ex:62: Troupe.Gateway.Artifacts.about/2
    (troupe_core 0.50.0-beta) lib/troupe/tools/publish_artifact.ex:157: Troupe.Tools.PublishArtifact.publication/2
    (troupe_core 0.50.0-beta) lib/troupe/tools.ex:582: Troupe.Tools.ask/5

So the call's task crashed before Approvals.request, the turn ended on the next scripted step, and no decision was written. Whether it fails depends on the seed: only when this test runs before any worker test that puts the pod's host back, such as this module's own on_exit. Only the deny test is hit. Its call names an id, which is the case where the daemon's about asks the plane. The allow test never asks.

Both shapes in the brief were checked and ruled out. In deny mode, approval_decided is appended by Session.Approvals through a synchronous Log.append before it replies to the tool, so it always comes before that call's tool_call_completed and the turn's turn_ended. A passing run's log shows 9 tool_call_started, 10 approval_requested, 11 approval_decided, 12 tool_call_completed, then 16 turn_ended. No earlier turn_ended exists for the wait to pass on. #1265's changes to manager.ex (cost reports) and agent/server.ex (compaction) are not on this path.

What changed

The setup installs the pod's whole host first (Troupe.Worker.Artifacts.install/0), then lays the test's publish over it. The gate now asks the pod's about, which answers :no_link without a link, whatever ran before. The test file is the only file changed. No product code changed and no decision was taken.

Verified

The leaked host reproduces the failure deterministically when the setup is preceded by Troupe.Gateway.Artifacts.install(), as the gateway suite leaves it. The injection was temporary and is not committed:

  • without the fix, under a 40-process CPU load: TOTAL pass=0 fail=5 of 5, each Result: 2/3 passed, the same assertion and the same Troupe.Gateway.Plane exit
  • with the fix, same injection and same load: TOTAL pass=20 fail=0 of 20, each Result: 3 passed

Before the fix and without the injection, the failure did not reproduce in the worker suite alone: the file 12 of 12 under load, the whole worker suite 4 of 4 under load (Result: 361 passed each). It needs the gateway suite before it in the same VM.

Gates on the branch:

  • worker suite whole: Finished in 120.8 seconds (1.4s async, 119.4s sync) / Result: 361 passed
  • mix credo --strict: 21559 mods/funs, found no issues.
  • mix format --check-formatted on the changed file: clean
  • elixir scripts/decision-citations.exs --base origin/development-2026-11-28-2: 1 file(s) changed since origin/development-2026-11-28-2, none adds a decision number to code

Decisions read: mix troupe.decisions --for the test file names 253 (terms become config overrides at the pod). This change does not touch that.

Left

Other suites' tests that install only a publish function (gateway proposal_answer_test.exs, several core tests) rely the same way on whatever about the VM holds. None of them was seen failing, and none is on this pod path, so they are untouched.

Its setup installed only the publish function, so the gate's question to the host about a new version went to whatever host the VM held. In the umbrella's run that was the daemon's, left by the gateway suite, whose about/2 calls Troupe.Gateway.Plane; no such process runs in the worker suite, so the publish call's task crashed before it reached the approval gate, and the deny test saw a turn_ended with no approval_decided. The setup now installs the pod's host first and lays the test's publish over it.

Signed-off-by: Martin Johannesson <martin.johannesson@it-minds.dk>
@misterjohannesson
misterjohannesson merged commit 9f39087 into development-2026-11-28-2 Nov 28, 2026
14 checks passed
@misterjohannesson
misterjohannesson deleted the fix/worker-proposal-run-test-race branch November 28, 2026 18:38
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