You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "UncertaintyDeterminesYou4ndMe (via GitHub)" <gi...@apache.org> on 2026/09/04 13:39:05 UTC

[I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

UncertaintyDeterminesYou4ndMe opened a new issue, #4785:
URL: https://github.com/apache/maka/issues/4785

   ## What happened
   
   `WorkHub correction replaces its link without stopping a shared manual Turn` (`packages/runtime-host/src/__tests__/execution-composition.test.ts:689`) fails intermittently on a clean `main` checkout. It is the most frequent Runtime Host flake on this machine: **10 of 13 full-suite runs** failed on it, and it reproduces in focused repetitions too (2 of 6, then 1 of 3).
   
   The assertion that fails is `assert.equal(delegated.ok, true)` on the `workhub.coordination.act` call. The rejection is not a timeout:
   
   ```
   {"ok":false,"error":{"code":"operation_conflict",
    "message":"WorkHub Session candidates changed; refresh before delegating"}}
   ```
   
   ## Root cause: the candidate-set identity includes the Session name, and the automatic title lands asynchronously
   
   `candidateSet` (`packages/runtime-host/src/server/workhub-coordination-action-gate.ts:960`) digests each eligible Session's `id`, `name`, workspace projection, `status` and `updatedAt` into `candidateSetId`. `workhub.coordination.act` rejects with `operation_conflict` when the id it is handed no longer matches (`:504`).
   
   The test starts a manual Turn, reads the candidate set, then delegates into it. Starting the Turn also triggers the automatic Session title, which commits on its own schedule. Dumping both candidate sets at the moment of the rejection shows exactly one field moved, and it is the name:
   
   ```
   BEFORE sha256:28184d9a…  [{ id: 7f5f66ee…, name: "New Chat",           status: running, updatedAt: 1788529087769 },
                             { id: 232443e9…, name: "New Chat",           status: active,  updatedAt: 1788529087758 }]
   AFTER  sha256:daa2d376…  [{ id: 7f5f66ee…, name: "__e2e_hold_open__",  status: running, updatedAt: 1788529087769 },
                             { id: 232443e9…, name: "New Chat",           status: active,  updatedAt: 1788529087758 }]
   ```
   
   `7f5f66ee…` is the source Session. `updatedAt` is byte-identical across the two reads; the title commit is the whole difference. Whether the test passes is therefore decided by whether the title lands before or after the `act` call.
   
   ## Beyond the test
   
   The conflict domain looks wider than the decision it protects. A delegation cares which Sessions are eligible and what state they are in; it does not depend on what any of them is called. As written, any automatic title committing anywhere in the workspace invalidates every in-flight WorkHub delegation, so a user who opens WorkHub and clicks delegate can lose the race to a title commit on an unrelated Session and be told to refresh. That is the same race the test loses, just with a human in it.
   
   Two directions, and which one is right is a maintainer call:
   
   1. Narrow the identity to the fields a delegation actually depends on — Session set, eligibility and status — and leave cosmetic fields such as `name` out of it. The candidate list would still be re-read; only the conflict would stop firing on a rename.
   2. Keep the identity as it is and make the caller tolerate `operation_conflict` by re-reading candidates and retrying once, which is what the message already tells clients to do.
   
   The test change follows from whichever is chosen: under (1) nothing is needed; under (2) the test should settle the title before reading candidates rather than racing it.
   
   ## How to reproduce
   
   ```bash
   npm ci
   npm --workspace @maka/runtime-host run build
   # full suite; fails on this test in most runs
   npm run test:dist --workspace @maka/runtime-host
   # focused; fails in roughly one run in three
   node --test \
     --test-name-pattern="WorkHub correction replaces its link without stopping a shared manual Turn" \
     packages/runtime-host/dist/__tests__/execution-composition.test.js
   ```
   
   The candidate-set dump above comes from printing `workhub.coordination.candidates` again inside the failure branch; the harness is not committed.
   
   ## Environment
   
   - Maka commit: `a9307d005` (source build), also seen on `4ed6255f2`
   - OS: macOS, Darwin 25.6.0, arm64, 10 cores
   - Surface: Runtime Host
   - Node.js: v24.19.0
   
   ## Additional context
   
   Found while investigating #4776, which is a different pair of tests; this one is unrelated to that fix and is filed separately as promised in #4784. #4776's own two tests did not fail once here in 42 focused repetitions and 19 full-suite runs.
   
   _Analysis produced with Claude Code; the runs, the candidate-set dump and this report were reviewed by me._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5837771934

   Follow-up on the `candidate_set_stale` from #5043's CI that the comment above left open. It is the same identity rotating, through `updatedAt` rather than `name`, and it needs nothing on the host.
   
   In `default production WorkHub selects and delegates through its durable Host interaction`, the test waits for the delegated Turn on `beta` to report `completed`, reads candidates, and starts a second `selectAndDelegate`. When that Turn completes, the `turn_state: completed` message is already in `beta`'s message log and `turn.query` already answers `completed`, but the `lastMessageAt` the candidate list derives `updatedAt` from still holds the assistant message's time. It catches up to the `turn_state` time a few milliseconds later. A candidate read inside that gap is rejected when the coordinator re-derives the set before offering the form, which is exactly "Discover fresh candidates before requesting a target choice".
   
   One run on `0cb4fc32b`, the base CI merged #5043 into (#5043 only touches `runtime/network`):
   
   | | `beta`'s `updatedAt` as the candidate list sees it |
   | --- | --- |
   | assistant message written | …1367 |
   | `turn_state: completed` written | …1370 |
   | read as `turn.query` reports completed, `turn_state` already in the log | …1367 |
   | coordinator re-derive, about 8 ms later | …1370, mismatch |
   
   Reading candidates the moment the Turn reports completed and passing that read to `selectAndDelegate` fails 10 of 10 times on that tree and 5 of 5 on current `main` (`8d5a3cac3`). The unmodified test did not fail in 30 runs under CPU load here: its poll interval and the following `interaction.query` usually give the record time to catch up, which fits one failure on a slower CI runner. I have not traced which write moves `lastMessageAt`.
   
   This path does not go through `name` or port 11434, so dropping `name` from the digest would leave it in place: an ordinary status message is enough to rotate the set. That supports keying the ref on the selected Session rather than narrowing the digest field by field.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5798417416

   ### Still reproducing on CI, through a second code path
   
   This race is still active. Since it was filed, CI has hit it on several unrelated branches, and the symptom is not limited to the test named above.
   
   **A second exit for the same candidate-set identity.** On `codex/fix-5009-host-lifecycle` (#5043, head `1b0141633`, [run 35847982862](https://github.com/apache/maka/actions/runs/35847982862)), `default production WorkHub selects and delegates through its durable Host interaction` failed with:
   
   ```
   {"ok":false,"error":{"code":"candidate_set_stale",
    "message":"Discover fresh candidates before requesting a target choice"}}
   ```
   
   That is a different code and message from the `operation_conflict` in the report above, and it is raised somewhere else — `packages/runtime-host/src/server/workhub-coordination-coordinator.ts:603`, rather than `packages/runtime-host/src/server/workhub-coordination-action-gate.ts:577`. Both compare a `candidateSetId` obtained from the same `#actionGate.candidates()` call, so the identity this issue describes has at least two rejection sites, and narrowing it would fix both.
   
   **Other recent failures, mechanism unconfirmed.** Further CI failures landed on `WorkHub Resume and Stop follow logical lineage across repeated physical handoffs`, in the same file:
   
   | Run | Branch | Head |
   | --- | --- | --- |
   | [35847862929](https://github.com/apache/maka/actions/runs/35847862929) | `refactor/remove-permission-mode-comp…` | `4483cd20b` |
   | [35848083445](https://github.com/apache/maka/actions/runs/35848083445) | `codex/fix-5448-codex-handoff-import` (#5450) | `09d72e78b` |
   | [35850296502](https://github.com/apache/maka/actions/runs/35850296502) | `perf/onboarding-incremental` | `fda730a67` |
   | [35872907099](https://github.com/apache/maka/actions/runs/35872907099) | `main` | `e6e35aefe` |
   
   Those logs only show `ERR_ASSERTION`, `actual: false, expected: true`, with no error code, so I cannot say from the logs alone whether they share this root cause. I am listing them because they are the same file and the same week, not as confirmed instances.
   
   **The named test no longer reproduces locally.** On current `main` (`9082cf144`), macOS 26.5.2 arm64, Node 24.21.0:
   
   - `WorkHub correction replaces its link without stopping a shared manual Turn`, focused, `--test-concurrency=1`: 6 rounds, 6 passed, 0 failed.
   - The whole `execution-composition.test.js` file: 5 rounds, 39 tests each, all passed.
   
   So a macOS checkout is not a good place to reproduce this now; the failures above are all on the Linux runners.
   
   **Why this still matters.** `main` itself failed on it today, so this is not confined to contributor branches, and #5043 and #5450 are currently blocked on a red `test` check that neither change can influence — neither touches `packages/runtime-host`.
   
   ---
   
   *Analysis produced with Claude Code; the CI logs, the source locations and the local runs above were reviewed by me.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Adarsh-Me (via GitHub)" <gi...@apache.org>.
Adarsh-Me commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5836101254

   Ran this on Linux-free Windows x64 (Node 24.21) against `0479fc761`: 12/12 focused runs pass, so I cannot reproduce the flake here and won't claim a before/after measurement.
   
   First attempt showed 9/9 failures — that was my environment, not the race: `@maka/acp-executor-plugin` is a newer workspace and was not linked, giving `ERR_MODULE_NOT_FOUND`. After `npm install` + building it, the run is clean.
   
   Next step I propose: a deterministic test that two candidate sets differing only in Session `name` produce the same `candidateSetId`, which pins option 1 without racing anything.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Adarsh-Me (via GitHub)" <gi...@apache.org>.
Adarsh-Me commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5541336955

   /take


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han closed issue #4785: flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity
URL: https://github.com/apache/maka/issues/4785


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Adarsh-Me (via GitHub)" <gi...@apache.org>.
Adarsh-Me commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5542519122

   take


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Adarsh-Me (via GitHub)" <gi...@apache.org>.
Adarsh-Me commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-6095049085

   #5862 fixes this: `candidateSetId` now digests only id, workspace and derived state, in id order, so a rename or timestamp on one Session can't rotate every `candidateRef`.
   
   Your injected-title repro is now a deterministic test — re-ran it today: fails with only the gate reverted, `candidate_set_stale`. The ~8 ms target-side `updatedAt` catch-up stays open for review.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "Adarsh-Me (via GitHub)" <gi...@apache.org>.
Adarsh-Me commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5798824599

   Confirmed your second site, and reading it against current `main` (`9082cf144`) changes what "narrowing the identity" has to cover. Analysis only here -- no patch, for the reason at the bottom.
   
   **The mechanism is one digest, not two bugs.** [`candidateSet()`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-action-gate.ts#L1118-L1145) builds `candidateSetId` as a digest over *every* eligible session's `id, name, workspace, status, updatedAt`. `candidates()` is not cached -- it is `candidateSet(await this.#effects.listSessions())`, re-derived from live session state on each call. So any unrelated session touching `updatedAt` rotates the whole identity, and the automatic Session title write named in the issue is exactly that kind of write. Both error codes you saw are that one digest being re-derived after the snapshot was taken.
   
   **Four comparison sites, not two.** Same call, same rotating id:
   
   - [`action-gate.ts:574`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-action-gate.ts#L573-L579) -- delegate, `candidate_set_stale`
   - [`action-gate.ts:816`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-action-gate.ts#L815-L820) -- replace, `candidate_set_stale`
   - [`action-gate.ts:961`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-action-gate.ts#L960-L962) -- correct, and this one `return`s silently, so it cannot surface as a code at all
   - [`coordinator.ts:601`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-coordinator.ts#L600-L606) -- your site, and the widest window: it sits inside the `create` callback of `#requestForm`, so the identity is re-derived *after an unbounded wait for a human to answer the form*. On that shape it does not matter what a branch under CI changes elsewhere, which is consistent with the two PRs you list being blocked on a check they cannot influence (I have not audited their diffs).
   
   **The narrowing has a snag worth naming before anyone writes it.** `candidateRef` is derived *from* the set id -- `` `whc_${hash(`${candidateSetId}\0${sessionId}`)}` `` at [line 1157-1159](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-action-gate.ts#L1157-L1159), applied at line 1137. So if `candidateSetId` has rotated by the time the form is answered, every ref the user was just offered has rotated with it, and the membership lookup at [`coordinator.ts:607-613`](https://github.com/apache/maka/blob/9082cf144bc1d7ff912fc5a4f5fd0e0abaf559d7/packages/runtime-host/src/server/workhub-coordination-coordinator.ts#L607-L613) fails for all of them. Dropping or relaxing the line 601 comparison on its own therefore does not fix the race -- it converts `candidate_set_stale` into `candidate_unavailable` and moves the rejection one frame down. Any fix has to make the ref itself stable, i.e. key `candidateRef` o
 n the selected session's identity rather than on a digest of the list it happened to be offered in, and then compare *that* rather than the set snapshot. `updatedAt` in the digest is what makes the identity churn on ordinary activity; `id` plus the workspace projection is what the decision actually depends on.
   
   That is a testable prediction, and it is the cheapest thing to check first: change nothing but the line 601 comparison and the failure should reappear as `candidate_unavailable`. If it does not, the reasoning above is wrong and worth discarding.
   
   **What I could not run here, so this stays analysis.** Your note that the named test passes 6/6 focused on macOS and the CI failures are all on Linux runners matches my position: this host has no Linux container runtime and `packages/runtime-host` has no installed workspace dependencies, so neither the flake nor a candidate fix can be executed and measured. I am not posting a patch against a race I cannot reproduce or disprove, and the four sites above are read, not exercised. Happy to take a fix if someone can drive it on a Linux runner -- or to write one against a reproduction I can actually trigger.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5812641653

   Reproduction attempts, all negative. Recording them so the next person does not
   repeat them.
   
   | Environment | Executions | WorkHub failures |
   | --- | --- | --- |
   | macOS 26.5.2 arm64, Node 24 | 11 rounds | 0 |
   | Linux x86_64, 4 cores, Node 24 | 12 rounds | 0 |
   | GitHub-hosted `ubuntu-24.04`, Node 24 | 56 full-suite executions | 0 |
   
   The CI attempts ran the full `@maka/runtime-host` `test:dist` suite with the command
   and runner image `ci.yml` uses, including the bubblewrap install and the AppArmor
   `unprivileged_userns` setting the managed Bash sandbox needs. Three machine states
   were tried: an otherwise idle runner (32 executions), CPU contention on two of four
   cores (15), and directly after the workspace test batch `ci.yml` schedules
   immediately before this suite (9). Neither `candidate_set_stale` nor
   `WorkHub Session candidates changed` appears in any of the 56 logs.
   
   None of this shows the race is gone. It was last seen in real PR runs, where this
   suite is one late step of a forty-step job with a 45-minute budget. What it does
   suggest is that reproducing it needs more of that job's accumulated state than the
   suite alone provides.
   
   One unrelated flake did surface under the CPU contention variant, filed separately
   as #5698.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5811420609

   ### Tried to reproduce on a real Linux host; could not
   
   You noted you cannot run this locally. I had a Linux box available, so I drove it there. It did not reproduce, and the way it failed to reproduce is itself informative.
   
   **Setup.** OpenCloudOS 9.4, x86_64, 4 cores, Node 24.15.0, current `main` (`9082cf144`), built from source, running the same command CI runs: `npm --workspace @maka/runtime-host run test:dist`.
   
   **Result: four consecutive full-suite rounds, zero WorkHub failures.**
   
   | Round | Tests | Pass | Fail | Duration |
   | --- | --- | --- | --- | --- |
   | 1 | 2102 | 2075 | 8 | 267 s |
   | 2 | 2102 | 2075 | 8 | 269 s |
   | 3 | 2102 | 2075 | 8 | 266 s |
   | 4 | 2102 | 2075 | 8 | 269 s |
   
   All three WorkHub tests in `execution-composition.test.js` passed in every round, twelve executions in total: the one named in this issue, `default production WorkHub selects and delegates through its durable Host interaction`, and `WorkHub Resume and Stop follow logical lineage across repeated physical handoffs`.
   
   The eight failures are mine, not the suite's: I skipped the Electron binary download, and the host runs as root without bubblewrap, so the Electron-launcher, sandbox-boundary and account-home tests fail on environment alone. They are identical across all four rounds and none of them is in this file.
   
   Focused runs do not reproduce it either: the named test alone, 6 rounds on this Linux host and 6 rounds on macOS 26.5.2 / Node 24.21.0, plus the whole file 5 rounds on macOS. 435 test executions, zero failures.
   
   **The duration is the interesting part.** A round here takes 266-269 s. The CI run that failed on #5043 reported `duration_ms 269573.896563`, i.e. 269 s. The suite is not running measurably faster or slower on this box than on the runner, so "a slower machine widens the window" does not explain the difference.
   
   **What still differs from `ubuntu-24.04`**, for whoever picks this up:
   
   | | GitHub runner | This host |
   | --- | --- | --- |
   | Memory | 16 GB | 3.6 GB |
   | Baseline load | dedicated, idle | ~4.0, other services resident |
   | Node | `node-version: 24` (latest 24.x) | 24.15.0 |
   | Filesystem | ext4 | xfs |
   | User | unprivileged `runner` | root |
   | `CI` env | `true` | unset |
   
   I have not isolated which of these matters. Note two of them point the opposite way from the obvious guess: this host has *less* memory and *more* baseline load than the runner, which should make a timing race more likely, not less.
   
   So the reproduction environment is narrower than "Linux". If anyone wants to drive the falsifiable experiment you proposed -- change only the line 601 comparison and see whether the failure reappears as `candidate_unavailable` -- GitHub Actions is the only place it is currently known to be observable.
   
   ---
   
   *Analysis produced with Claude Code; the runs, the timings and the CI log references above were reviewed by me.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5837556593

   Larger batches of the two reproductions above, same `main`:
   
   - Title injected to land just after `workhub.coordination.candidates`: 20 of 20 delegations fail with `candidate_set_stale`.
   - The named test unmodified, with a stub on `127.0.0.1:11434` answering 404 after 20 ms: 20 of 20 runs fail. The same test with nothing on the port: 0 of 10.
   
   The 20 ms figure is where the delegation window sits on this machine; it is only a few tens of milliseconds wide and will sit elsewhere on a faster or slower host. Injecting the title does not depend on timing, so it is the one to build a failing test on.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] flaky(runtime-host): WorkHub delegation races the automatic Session title through the candidate-set identity [maka]

Posted by "sunrioa (via GitHub)" <gi...@apache.org>.
sunrioa commented on issue #4785:
URL: https://github.com/apache/maka/issues/4785#issuecomment-5837492143

   Two updates: a correction to my earlier comment, and a reproduction that no longer depends on the machine.
   
   **Correction.** The four `WorkHub Resume and Stop follow logical lineage across repeated physical handoffs` runs I listed under "mechanism unconfirmed" are not this issue, and "no error code" was wrong. The code is in the assertion message: all four are `session_busy` / "Session already has an active or pending root Turn". #5595 made a stopped delegation send a Host result Turn back to the WorkHub Session, and that test started its next Turn on the same Session before the result Turn finished. #5300 fixed it in the test with `waitForResultCompletion` (730713131). All four failing trees contain #5595 and none contain 730713131. They can be dropped from the evidence here.
   
   **A reproduction on any OS.** The reasoning above holds on current `main` (`8d5a3cac3`):
   
   - `candidateSet` with only one Session's `name` changed, or only its `lastMessageAt`, yields a different `candidateSetId`, and every candidate's `candidateRef` changes with it, including Sessions that did not change. The deterministic test proposed above fails as it stands.
   - End to end: injecting `generateSessionTitle` (from #5022) so the title lands just after `workhub.coordination.candidates` fails the delegation 20 of 20 times with `candidate_set_stale` / "refresh before delegating".
   
   **Why it looks tied to one machine.** The test's fake connection is `ollama` at its default `http://127.0.0.1:11434/v1`, so the title's latency is whatever that port on the test host does. With the named test unmodified and a stub on that port answering 404 after a set delay, six rounds each:
   
   | Added delay | Failures | Where |
   | --- | --- | --- |
   | 0 ms | 2 of 6 | edge of the delegation window |
   | 20 ms | 6 of 6 | delegation, action-gate 571 |
   | 40 ms, 80 ms | 0 of 6 | between the two windows |
   | 150 ms | 6 of 6 | correction, action-gate 814, "refresh before replacing" |
   | 300 ms, 1000 ms | 0 of 6 | after both |
   | nothing listening | 0 of 10 | title lands after ~6 s |
   
   With nothing on the port the connection is refused in about 24 ms, but the title call does not pass `maxRetries: 0` the way the intent and recall calls in the same file do, so the SDK retries three times with backoff and the fallback title lands after about 6 s, past both windows. That fits a flake that failed 10 of 13 times on one machine and not once in roughly 500 runs on four others without anything on 11434. I have not seen the original machine, so this is consistent with it rather than proven.
   
   It does not explain the `candidate_set_stale` on #5043's CI (a different test, the coordinator site), where nothing listens on 11434. That one is the same identity rotating on some other write; I have not identified which.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org