fix: scheduled runs take at most 8 testers, a long log no longer loses its report, and a hidden window is Windows only #128

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/schedule-cap into main 2026-11-21 06:21:55 +00:00
Owner

Three farm problems found in the status checks, fixed:

  1. Scheduled regression runs stopped at 01:19 UTC. A scheduled run makes one target per connected tester, and a plan takes at most 8 targets. With 9 testers online, every look was refused (target must have 1 to 8 entries, every ~40 s), and no nightly was tested. It now picks 8 of them, a different 8 for each nightly (regression.some_testers, by the candidate's commit).
  2. A report was refused for its log. The agent capped log_tail at 64 KB, then hid names in it. A short name becoming <user> made it longer again, and the farm refused the whole report (#1813, nightly-217).
    • The agent now caps it again after hiding names.
    • The farm keeps the last 64 KB instead of refusing, for apps already out there.
  3. linux+window targets. #1282's plan had linux+window targets, which can never match, since only Windows testers have the window tag. Both plan readers now refuse a window scenario whose target has linux, and the planner is told.

Also seen: the first hidden-window run (#1282, an NVIDIA RTX 4050 Laptop GPU) measured normally. 3 of 4 game starts ran and presented to the window, which never showed on screen.

Tests on throwaway containers: the coordinator, 614 passed and 1 skipped; the agent, 2303 checks passed. Nothing on screen changes.

🤖 Generated with Claude Code

Three farm problems found in the status checks, fixed: 1. **Scheduled regression runs stopped at 01:19 UTC.** A scheduled run makes one target per connected tester, and a plan takes at most 8 targets. With 9 testers online, every look was refused (`target must have 1 to 8 entries`, every ~40 s), and no nightly was tested. It now picks 8 of them, a different 8 for each nightly (`regression.some_testers`, by the candidate's commit). 2. **A report was refused for its log.** The agent capped `log_tail` at 64 KB, then hid names in it. A short name becoming `<user>` made it longer again, and the farm refused the whole report (#1813, nightly-217). - The agent now caps it again after hiding names. - The farm keeps the last 64 KB instead of refusing, for apps already out there. 3. **`linux+window` targets.** #1282's plan had `linux+window` targets, which can never match, since only Windows testers have the `window` tag. Both plan readers now refuse a window scenario whose target has `linux`, and the planner is told. Also seen: the first hidden-window run (#1282, an NVIDIA RTX 4050 Laptop GPU) measured normally. 3 of 4 game starts ran and presented to the window, which never showed on screen. Tests on throwaway containers: the coordinator, 614 passed and 1 skipped; the agent, 2303 checks passed. Nothing on screen changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix: scheduled runs take at most 8 testers, a long log no longer loses its report, and a hidden window is Windows only
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 7s
CI / Coordinator tests (pull_request) Failing after 1m28s
CI / Agent build and checks (pull_request) Successful in 48s
CI / Coordinator image (pull_request) Successful in 9s
5d3e7b398e
- regression.some_testers: a scheduled run had one target per connected
  tester, and a plan takes at most 8. With 9 online every look failed from
  01:19 UTC, every 40 s, and no nightly was tested. Now 8 of them, a different
  8 for each nightly (by the candidate's commit).
- The agent caps log_tail again after its scrub: a short name it hides becomes
  a longer one (<user>), and the farm refused the whole report ("report.log_tail
  must be a string of at most 64 KB", #1813). The farm now keeps the last 64 KB
  instead of refusing, for the apps out there, and reads a lone surrogate as ?.
- A window scenario's target never has the linux tag: only Windows testers have
  the window tag, and #1282's linux+window jobs would wait for ever. Both plan
  readers refuse it (fixture bad-window-linux.toml) and the planner is told.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: fix: scheduled runs take at most 8 testers, a long log no longer loses its report, and a hidden window is Windows only to fix: scheduled runs take at most 8 testers, a long log no longer loses its report, and a hidden window is Windows only 2026-11-21 06:21:52 +00:00
HumanBean deleted branch fix/schedule-cap 2026-11-21 06:21:56 +00:00
BeanBot left a comment

Recommendation: Request changes. The eight-target cap restores scheduling, but the report fallback can still lose a report at database insertion, and the agent can reject runnable Windows jobs from already-queued plans. The three independent fixes also need separate pull requests under Beanstalk’s contribution rules.

Scheduled comparisons can queue when more than eight tester accounts are eligible. The patch also caps scrubbed logs and rejects impossible Linux targets in hidden-window plans. With nine eligible accounts, each comparison omits one account and its PCs, so a regression specific to that hardware can go untested.

@fix will do (9)

  1. L1 coordinator/beanstalk/reports.py:163: The fallback caps the displayed report, but a legacy submission still stores the original base64 payload in reports.envelope at line 414. (more on the line)
  2. L2 coordinator/beanstalk/reports.py:156: UTF-8 encoding leaves NUL intact, and PostgreSQL rejects it in jsonb. (more on the line)
  3. L3 agent/Core/Plan.cs:1318: The agent now rejects a whole existing schema-10 ticket if any sibling target contains linux. (more on the line)
  4. L4 coordinator/beanstalk/planner.py:172: The prompt cannot resolve an impossible target pinned by a maintainer. (more on the line)
  5. L5: CONTRIBUTING.md requires one topic per pull request. Scheduled tester selection, report ingestion, and hidden-window validation fix independent failures and can ship independently. Split them into three pull requests with the relevant checks in each.
  6. L6 agent/Core/Report.cs:341: The existing agent test fills the retained suffix with plain x characters, so it passes if the new post-scrub cap is removed. (more on the line)
  7. L7 (minor) coordinator/tests/test_reports.py:171: The multibyte character is outside the retained suffix, so the test never exercises a cut inside a UTF-8 character. (more on the line)
  8. L8 (minor) coordinator/beanstalk/regression.py:90: Hashing by commit can select the same eight on consecutive nightlies. (more on the line)
  9. L9 (minor) docs/test-plan.md:531: The schema guide tells authors to add window but omits the new explicit rejection of linux. Document both tag rules here so an author updating a Linux plan can see why adding window alone still fails.

Checks: Still running: CI / Coordinator tests (pull_request), CI / Agent build and checks (pull_request), CI / Coordinator image (pull_request), CI / Conventional Commit title (pull_request), CI / Workflow lint (actionlint) (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Yes for the tested coordinator cases. The new integration test registers 10 testers and checks that a run queues with 8 targets. The author reports 614 coordinator tests passed, 1 skipped, and 2,303 agent checks passed. The reported 3 of 4 hidden-window starts on one Windows NVIDIA laptop show that the existing window path can present, but provide no head-versus-base evidence for this fix. Production recovery after the reported roughly 40-second refusal cycle remains unverified.

Other systems: Tester selection happens after the existing eligibility and privacy filters, with no GPU, driver or OS weighting. The cap can omit the only PC with a particular GPU, driver or Steam Deck configuration. Log handling is shared by Windows and Linux agents and affects report ingestion, PostgreSQL storage and the report page. Hidden-window validation affects local plans, planner output, manual runs and signed tickets. The diff does not touch game rendering, saves, audio, input, or the build and sandbox implementations.

Switches: None. The negative fixture reuses RX_VK_ACQUIRE_AHEAD values 0 and 1 from the existing positive fixture. No Longshot switch default or table changes.

Reviewed: 5d3e7b398e against 14cc1aa3d7: Read AGENTS.md, CONTRIBUTING.md, the sole commit, all ten file diffs and the complete new fixture. Read the changed code and tests in context, including target normalization, scheduler offers and ticket reads, planner retry and fallback, report creation and database insertion, and the fixture harness. Skimmed the relevant protocol, report schema, plan, deployment and usage docs and CI workflow. Unrelated portions of the larger changed files were outside the source trace. No local review checklist, PR template, recorded run artifact, translation change or generated file change was present. The supplied comments and reviews were empty.; nothing run (a code review).

Checked and fine:

  • The coordinator shares the eight-target limit between scheduling and plan validation. Selected accounts keep their existing report counts and stable target order.
  • Both readers accept the existing Windows window fixture, and the new Linux fixture exercises rejection on the agent and coordinator. The fixture reuses an existing authored plan and adds no game asset or sampled output.
  • The agent caps the scrubbed tail before sizing the final report. The coordinator continues to reject non-string tails.
  • The changes introduce no shared mutable state, platform-specific file I/O, dependency changes or new commands. The commit has both required AI trailers.

Testing: Read-only review. No builds or tests were run. The five listed CI checks were pending. Existing CI runs the agent checks on Ubuntu and cross-publishes the Windows build. The supplied counts do not establish a Windows test execution on this head.

Overlaps and merge order: None identified in the checkout or supplied review context.


Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The eight-target cap restores scheduling, but the report fallback can still lose a report at database insertion, and the agent can reject runnable Windows jobs from already-queued plans. The three independent fixes also need separate pull requests under Beanstalk’s contribution rules. Scheduled comparisons can queue when more than eight tester accounts are eligible. The patch also caps scrubbed logs and rejects impossible Linux targets in hidden-window plans. With nine eligible accounts, each comparison omits one account and its PCs, so a regression specific to that hardware can go untested. **`@fix` will do (9)** 1. **L1** `coordinator/beanstalk/reports.py:163`: The fallback caps the displayed report, but a legacy submission still stores the original base64 payload in reports.envelope at line 414. (more on the line) 2. **L2** `coordinator/beanstalk/reports.py:156`: UTF-8 encoding leaves NUL intact, and PostgreSQL rejects it in jsonb. (more on the line) 3. **L3** `agent/Core/Plan.cs:1318`: The agent now rejects a whole existing schema-10 ticket if any sibling target contains linux. (more on the line) 4. **L4** `coordinator/beanstalk/planner.py:172`: The prompt cannot resolve an impossible target pinned by a maintainer. (more on the line) 5. **L5**: CONTRIBUTING.md requires one topic per pull request. Scheduled tester selection, report ingestion, and hidden-window validation fix independent failures and can ship independently. Split them into three pull requests with the relevant checks in each. 6. **L6** `agent/Core/Report.cs:341`: The existing agent test fills the retained suffix with plain x characters, so it passes if the new post-scrub cap is removed. (more on the line) 7. **L7** (minor) `coordinator/tests/test_reports.py:171`: The multibyte character is outside the retained suffix, so the test never exercises a cut inside a UTF-8 character. (more on the line) 8. **L8** (minor) `coordinator/beanstalk/regression.py:90`: Hashing by commit can select the same eight on consecutive nightlies. (more on the line) 9. **L9** (minor) `docs/test-plan.md:531`: The schema guide tells authors to add window but omits the new explicit rejection of linux. Document both tag rules here so an author updating a Linux plan can see why adding window alone still fails. **Checks:** Still running: `CI / Coordinator tests (pull_request)`, `CI / Agent build and checks (pull_request)`, `CI / Coordinator image (pull_request)`, `CI / Conventional Commit title (pull_request)`, `CI / Workflow lint (actionlint) (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the tested coordinator cases. The new integration test registers 10 testers and checks that a run queues with 8 targets. The author reports 614 coordinator tests passed, 1 skipped, and 2,303 agent checks passed. The reported 3 of 4 hidden-window starts on one Windows NVIDIA laptop show that the existing window path can present, but provide no head-versus-base evidence for this fix. Production recovery after the reported roughly 40-second refusal cycle remains unverified. **Other systems:** Tester selection happens after the existing eligibility and privacy filters, with no GPU, driver or OS weighting. The cap can omit the only PC with a particular GPU, driver or Steam Deck configuration. Log handling is shared by Windows and Linux agents and affects report ingestion, PostgreSQL storage and the report page. Hidden-window validation affects local plans, planner output, manual runs and signed tickets. The diff does not touch game rendering, saves, audio, input, or the build and sandbox implementations. **Switches:** None. The negative fixture reuses RX_VK_ACQUIRE_AHEAD values 0 and 1 from the existing positive fixture. No Longshot switch default or table changes. **Reviewed:** 5d3e7b398e3e against 14cc1aa3d71a: Read AGENTS.md, CONTRIBUTING.md, the sole commit, all ten file diffs and the complete new fixture. Read the changed code and tests in context, including target normalization, scheduler offers and ticket reads, planner retry and fallback, report creation and database insertion, and the fixture harness. Skimmed the relevant protocol, report schema, plan, deployment and usage docs and CI workflow. Unrelated portions of the larger changed files were outside the source trace. No local review checklist, PR template, recorded run artifact, translation change or generated file change was present. The supplied comments and reviews were empty.; nothing run (a code review). **Checked and fine:** - The coordinator shares the eight-target limit between scheduling and plan validation. Selected accounts keep their existing report counts and stable target order. - Both readers accept the existing Windows window fixture, and the new Linux fixture exercises rejection on the agent and coordinator. The fixture reuses an existing authored plan and adds no game asset or sampled output. - The agent caps the scrubbed tail before sizing the final report. The coordinator continues to reject non-string tails. - The changes introduce no shared mutable state, platform-specific file I/O, dependency changes or new commands. The commit has both required AI trailers. **Testing:** Read-only review. No builds or tests were run. The five listed CI checks were pending. Existing CI runs the agent checks on Ubuntu and cross-publishes the Windows build. The supplied counts do not establish a Windows test execution on this head. **Overlaps and merge order:** None identified in the checkout or supplied review context. </details> --- <sub>Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -1315,0 +1315,4 @@
// (only Windows testers have the tag for now: linux+window would wait for ever, Nov 2026)
foreach (var t in targets)
if (t["tags"]!.AsArray().Any(x => (string?)x == "linux"))
throw new PlanException($"target {(string?)t["name"]}: only Windows testers can run a hidden window for now; leave linux out (tags = [\"windows\", \"window\", ...])");
Member

L3: The agent now rejects a whole existing schema-10 ticket if any sibling target contains linux. A stored plan with windows+window and linux+window still gets offered to a Windows tester because the coordinator sends all stored targets in the ticket. The upgraded agent refuses it before checking the job's own target. Preserve reads of existing tickets for compatible job targets, or migrate queued plans and their impossible jobs before deploying the stricter reader. Cover a mixed-target ticket in the agent checks.

**L3**: The agent now rejects a whole existing schema-10 ticket if any sibling target contains linux. A stored plan with windows+window and linux+window still gets offered to a Windows tester because the coordinator sends all stored targets in the ticket. The upgraded agent refuses it before checking the job's own target. Preserve reads of existing tickets for compatible job targets, or migrate queued plans and their impossible jobs before deploying the stricter reader. Cover a mixed-target ticket in the agent checks.
@ -338,1 +338,4 @@
scrubbed["target"] = x.Target;
// (capped again after the scrub: a short name it hides becomes a longer one (<user>), and a tail over MaxLogTail had the
// farm refuse the whole report)
scrubbed["log_tail"] = Tail((string?)scrubbed["log_tail"] ?? "", MaxLogTail);
Member

L6: The existing agent test fills the retained suffix with plain x characters, so it passes if the new post-scrub cap is removed. Add a Report.Build case using a synthetic short name repeatedly at word boundaries. Check that redaction expands the input past 64 KiB and that the outgoing tail is scrubbed, within the UTF-8 byte cap, and retains its end.

**L6**: The existing agent test fills the retained suffix with plain x characters, so it passes if the new post-scrub cap is removed. Add a Report.Build case using a synthetic short name repeatedly at word boundaries. Check that redaction expands the input past 64 KiB and that the outgoing tail is scrubbed, within the UTF-8 byte cap, and retains its end.
@ -170,3 +170,3 @@
their screen), so the present path runs: the swapchain, acquiring its next image, pacing at present, and the log
lines they print. Use it ONLY for a change that acts when the game presents to a window. Only testers with the
window tag can (Windows for now): every target of a plan with a window scenario lists "window" in its tags, and a
window tag can (Windows only for now: never with the linux tag): every target of a plan with a window scenario lists "window" in its tags, and a
Member

L4: The prompt cannot resolve an impossible target pinned by a maintainer. For a manual window run with both linux+window and windows+window pinned, fixed_targets restores the Linux target even if the model omits it. After two refusals, the default headless plan can queue on Windows and produce a result without exercising presentation. Reject impossible pinned combinations at submission, or hold the run with the target error before the headless fallback. Test that the mixed request queues no fallback jobs.

**L4**: The prompt cannot resolve an impossible target pinned by a maintainer. For a manual window run with both linux+window and windows+window pinned, fixed_targets restores the Linux target even if the model omits it. After two refusals, the default headless plan can queue on Windows and produce a result without exercising presentation. Reject impossible pinned combinations at submission, or hold the run with the target error before the headless fallback. Test that the mixed request queues no fallback jobs.
@ -86,1 +87,4 @@
def some_testers(targets: list[tuple[str, int]], seed: str) -> list[tuple[str, int]]:
"""At most plans.MAX_TARGETS of the testers' targets, in tag order: a plan takes no more (Nov 2026: 9 testers online,
and every look failed for 5 h). Which ones turns with the candidate's commit, so each nightly asks other testers"""
Member

L8 (minor): Hashing by commit can select the same eight on consecutive nightlies. With nine stable eligible accounts, the same account can miss both comparisons, despite the PR and helper promising a different group each time. Describe the selection as a deterministic sample that can repeat, and update docs/using.md and docs/deploy.md, which still promise every connected PC.

**L8** (minor): Hashing by commit can select the same eight on consecutive nightlies. With nine stable eligible accounts, the same account can miss both comparisons, despite the PR and helper promising a different group each time. Describe the selection as a deterministic sample that can repeat, and update docs/using.md and docs/deploy.md, which still promise every connected PC.
@ -154,1 +153,4 @@
if not isinstance(log_tail, str):
raise ReportError("report.log_tail must be a string of at most 64 KB")
try:
raw = log_tail.encode("utf-8")
Member

L2: UTF-8 encoding leaves NUL intact, and PostgreSQL rejects it in jsonb. An oversized log with a NUL in its retained suffix now passes validation, then fails the INSERT and rolls back the report. Normalize NUL before persistence and add a submission test that verifies the stored tail and completed job.

**L2**: UTF-8 encoding leaves NUL intact, and PostgreSQL rejects it in jsonb. An oversized log with a NUL in its retained suffix now passes validation, then fails the INSERT and rolls back the report. Normalize NUL before persistence and add a submission test that verifies the stored tail and completed job.
@ -155,0 +160,4 @@
if len(raw) > MAX_LOG:
# (its end is kept, not the report refused: an agent's scrub after its own cap can make it longer, a user's name
# becoming <user>; nightly-217 lost a whole report so, Nov 2026)
doc["log_tail"] = raw[-MAX_LOG:].decode("utf-8", "ignore")
Member

L1: The fallback caps the displayed report, but a legacy submission still stores the original base64 payload in reports.envelope at line 414. An older agent can send a multi-megabyte log under the request limit and the farm will retain the entire log in the audit column. Bound the retained log for both submission formats. If exact legacy envelopes must be preserved for audit, define and enforce a compatibility limit for oversized logs and document what is retained.

**L1**: The fallback caps the displayed report, but a legacy submission still stores the original base64 payload in reports.envelope at line 414. An older agent can send a multi-megabyte log under the request limit and the farm will retain the entire log in the audit column. Bound the retained log for both submission formats. If exact legacy envelopes must be preserved for audit, define and enforce a compatibility limit for oversized logs and document what is retained.
@ -167,0 +168,4 @@
"""An agent's scrub after its own cap can make the tail longer (a name becoming <user>): its end is kept, not the
report refused"""
doc = _valid()
doc["log_tail"] = "é" + "x" * (64 * 1024) + "the end"
Member

L7 (minor): The multibyte character is outside the retained suffix, so the test never exercises a cut inside a UTF-8 character. Place a multibyte character across the cutoff and assert the exact retained suffix. The current bounds and endswith checks would also accept a tail reduced to just the final marker.

**L7** (minor): The multibyte character is outside the retained suffix, so the test never exercises a cut inside a UTF-8 character. Place a multibyte character across the cutoff and assert the exact retained suffix. The current bounds and endswith checks would also accept a tail reduced to just the final marker.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!128
No description provided.