Skip to content

fix(tests): match expectations, goldens and generated files to merged fork features - #91

Open
zereight wants to merge 1 commit into
mainfrom
fix/stale-test-expectations
Open

zereight wants to merge 1 commit into
mainfrom
fix/stale-test-expectations

Conversation

@zereight

@zereight zereight commented Dec 2, 2026

Copy link
Copy Markdown
Owner

What changed

Tests, goldens and one generated file that fork feature PRs left behind now match the merged behaviour. The only product file touched is the box environment allow-list. It gains one name, OMB_GATE_GUARDRAILS_FILE.

file change cause (commit, PR)
server/thread-capacity-api.test.ts, server/parallel-threads.e2e.test.ts GET/PATCH /api/config threads now also expects autoArchive: true, autoArchiveDays: 5, questionNudge: true, questionNudgeMinutes: 30. The on-disk config.json check is unchanged. server/index.ts:11655 spreads autoArchiveStatus(cfg) (#8, e65c84a76, moved in 5c1836057) and questionNudgeStatus(cfg) (#55, 7755cd9f0) into the response
server/index.test.ts features expects checkpoints: true (3 places). The persona section is bytes: 76. features.checkpoints added in #65 (29c0e6aef). The rename (#35, e8fc8d7d0) changed "OpenMausBot" to "OpenMyBot" in the expected text but left the byte count at 78. Buffer.byteLength of the expected text is 76.
server/independent-task-store.test.ts The "cannot be saved" case spies on saveBotThread instead of saveBotsSoon Upstream milind-soni#6198 (92cedf056) replaced saveBotsSoon() with saveBotThread(...) in commitBotChange. The spy target no longer existed (The property "saveBotsSoon" is not defined).
src/components/Sidebar.folder-show-all.test.ts, src/components/Sidebar.pinned-show-all.dom.test.ts The threads meant to be hidden in the default list are now archived. The stale "short list keeps six" comments are removed. #36 (64410f339, merged as 0ae53524f) lists every live thread and folds only archived, closed or snoozed ones. The cap is not restored.
shared/settings-places.ts Regenerated with node --experimental-strip-types scripts/gen-settings-places.ts. One row changes: "Export full backup" becomes "Export backup", and the word list gains "essentials backup". #33 (3832d73a7) renamed the export row
server/drivers/agents-catalog-goldens/{full.tools-list.json,profiles.json} Regenerated with UPDATE_AGENTS_CATALOG_GOLDENS=1. full.tools-list.json changes only the workflow description (adds fallbacks:[{instance_id,model,effort}] and the "optional fallbacks, up to 3" sentence). profiles.json changes only bytes/sha256: 124 lines, no tool names. All profiles stay within BUDGET_BASELINE. #64 (c8c2e2d62)
src/locales/pt-br.json 17 translated keys: settings.browser.chrome* (16) and composer.frequentSkills.aria. Placeholders match English (checked with jq). #38 (a86f637cd) and #74 (e0d259c04) added English only. i18n.test.ts requires pt-br to be complete.
server/bot-box/env.test.ts OMB_WORKTREE_BASE/BRANCH/PATH/REPO added to SERVER_ONLY_OMB #54 (bed901bd4). The server sets them only for worktree setup commands it runs itself with execFileAsync, outside any box (server/worktrees.ts:413-427).
server/bot-box/env.ts OMB_GATE_GUARDRAILS_FILE added to BOX_ENV_OMB_NAMES, next to its OMB_GATE_* siblings #67 (c43c25f47). See the next section.

OMB_GATE_GUARDRAILS_FILE (code reading, not a run)

env.test.ts asks every OMB_ name to be decided, and OMB_GATE_GUARDRAILS_FILE had no decision. Its reader is the MCP gate proxy (server/mcp-gate.ts:71). By the test's own rule ("add each to BOX_ENV_OMB_NAMES … if a bot's engine, hook or MCP proxy reads it"), it belongs with the other OMB_GATE_* names.

This is not a runtime fix. From reading the code, guardrails inside a box do not depend on this list today:

  • The box filters only the environment of the process it starts (server/bot-box/box.ts:137-139, reached from boxedSpawn in server/procs.ts).
  • gateServer puts the gate settings, OMB_GATE_GUARDRAILS_FILE included, in the MCP server spec's own env (server/mcp-gate-config.ts:215-236). The engine passes that env directly when it starts the gate, so it never goes through the box filter:
    • Claude: --mcp-config (server/drivers/claude.ts:1140)
    • Pi: the mcp.json file (server/drivers/pi-mcp-servers.ts:44, server/drivers/pi.ts:448)
    • ACP: server/drivers/turn-mcp.ts:49-78
  • Codex is the one engine that reads gate settings from its own environment. It gets them as one JSON value under OMB_GATE_CONFIG_<sha256> (server/drivers/codex.ts:467), which passes through the OMB_GATE_CONFIG_ prefix in BOX_ENV_OMB_PREFIXES.

The box runs only on Linux with bubblewrap. No boxed turn was run for this PR.

Why

All 12 files fail on every main run (vitest shards). In each case the feature PR changed behaviour on purpose, and the test, golden or generated file was not updated with it. No test case is deleted. Each assertion keeps checking what it checked before, against current behaviour.

How it was verified

macOS, Node v24.22.1 (same major as CI). The same command was run on main 8c67e9d and on this branch:

pnpm exec vitest run server/thread-capacity-api.test.ts server/parallel-threads.e2e.test.ts src/components/settings/settings-places.test.ts src/components/Sidebar.folder-show-all.test.ts src/components/Sidebar.pinned-show-all.dom.test.ts src/lib/i18n.test.ts server/drivers/agents-bridge-wire.test.ts server/drivers/agents-catalog-wire.test.ts server/bot-box/env.test.ts server/activity.test.ts server/index.test.ts server/independent-task-store.test.ts
file Before (main) After (this branch)
thread-capacity-api.test.ts 10 failed / 10 passes (10)
parallel-threads.e2e.test.ts 1 failed / 29 passes (29)
index.test.ts 2 failed / 348 passes (348)
agents-catalog-wire.test.ts 2 failed / 55 passes (55)
agents-bridge-wire.test.ts 2 failed / 43 passes (43)
Sidebar.pinned-show-all.dom.test.ts 2 failed / 4 passes (4)
Sidebar.folder-show-all.test.ts 1 failed / 3 passes (3)
settings-places.test.ts 1 failed / 3 passes (3)
bot-box/env.test.ts 1 failed / 9 passes (9)
independent-task-store.test.ts 1 failed / 33 passes (33)
i18n.test.ts 1 failed / 36 1 failed / 36 (see below)
activity.test.ts 1 failed / 31 1 failed / 31 (see below)
total Test Files 12 failed (12), Tests 25 failed | 579 passed (604) Test Files 2 failed | 10 passed (12), Tests 2 failed | 602 passed (604)

Before the change, env.test.ts listed the undecided names as OMB_GATE_GUARDRAILS_FILE, OMB_WORKTREE_BASE, OMB_WORKTREE_BRANCH, OMB_WORKTREE_PATH, OMB_WORKTREE_REPO.

Other tests that read the same goldens, pt-br.json, the box allow-list or settings-places also pass: src/locales, cloud-send, server-error, tool-schema-profile, AppMessage.compact, brief-words, app-settings/places (Test Files 22 passed (22), Tests 143 passed | 3 todo (146)). pnpm typecheck exits 0. oxlint --deny-warnings on the changed files exits 0. The pre-push hook reported pre-push: 12 changed file(s) checked in 5.1 s.

Failures left after this PR

  • activity.test.ts "names this app's own tools by an activity.tool key whose English is exactly the label" is fixed by the fix/activity-workflow-tool-labels PR. feat(workflows): add built-in chat tools for Workflows #52 (4da2845e2, merged as 85f60873b) added the workflow_info, workflow and delete_workflow tools without activity.tool.* label keys. That is a product gap, not a stale test.
  • i18n.test.ts "is true only for a pack other than English that has every English key" still misses one pt-br key: task.helperGroup ("Opened by bots"). Fork feat(sidebar): badge bot-opened threads instead of a separate group #5 (bd8f97e0a) removed this key from every locale along with the "Opened by bots" group. The chore(sync): merge upstream OpenMausBot 0.1.175 #42 conflict resolution brought it back in en.json and SidebarThreadRow.tsx:118 only. Whether that group stays is an open product decision, so this PR does not translate the key. If the group goes, the key leaves en.json. If it stays, pt-br needs one line.

Not covered

  • Full pnpm test was not run locally. The other shard failures on main have separate causes and separate PRs.
  • No boxed (Linux bubblewrap) turn was run. The OMB_GATE_GUARDRAILS_FILE reasoning above comes from reading the code.
  • The two HTTP e2e files ran on macOS, not on the Linux CI runner.
  • The pt-br strings are a developer translation, not reviewed by a native speaker.

Checklist

  • pnpm typecheck and pnpm test pass locally: typecheck passes; only the 12 files above (and the 22 related ones) were run, and 2 known cases still fail.
  • Server behavior changes come with tests: the one allow-list addition is covered by env.test.ts
  • No dist-server/ edits
  • macOS-only code is platform-gated: none added
  • No secrets in logs, responses, events, or argv

… fork features

Config threads now carry auto-archive (#8) and question-nudge (#55) status; features carry checkpoints (#65); the persona line is two bytes shorter since the rename (#35); the Store saves through saveBotThread (upstream milind-soni#6198); every live thread is listed (#36); the export row reads Export backup (#33); the workflow tool documents fallbacks (#64); pt-br gets the Chrome update (#38) and frequent-skills (#74) strings; OMB_WORKTREE_* (#54) stays on the server and OMB_GATE_GUARDRAILS_FILE (#67) is a gate setting like its siblings.
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