chore(tests): remove 6 dead pi-embedded vi.mock shims#2390
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 17, 2026
Merged
chore(tests): remove 6 dead pi-embedded vi.mock shims#2390alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
Production code no longer imports `pi-embedded.js` or `pi-embedded-runner/runs.js` — they were removed by prior gut commits (#2146/#2273, #2367, #2377). These 6 vi.mock calls registered mock factories against paths nothing resolves; vitest never invoked them. Deleted mocks: - src/agents/subagent-announce.timeout.test.ts - src/agents/subagent-announce.format.e2e.test.ts - src/auto-reply/reply/abort.test.ts - src/auto-reply/reply/get-reply-run.media-only.test.ts - src/cli/gateway-cli/run-loop.test.ts - src/cron/isolated-agent/run.test-harness.ts Also removed dead state tied to each mock: - run-loop.test.ts: local abortEmbeddedPiRun / getActiveEmbeddedRunCount / waitForActiveEmbeddedRuns vi.fn()s plus their setup calls and the comment at the SIGUSR1 restart assertion - run.test-harness.ts: runEmbeddedPiAgentMock export and its makeDefaultEmbeddedResult/reset helpers Pre-existing failures in four of the touched files (subagent-announce.timeout.test.ts, abort.test.ts, get-reply-run.media-only.test.ts, subagent-announce.format.e2e.test.ts) are unrelated semantic drift (session routing, ACP cancel flow, think-level extraction, message format) — pass/fail counts are identical before and after this change. Follow-up: ratchet the fork-openclaw skill's "≤6" invariant back to "0 matches" in HQ once this lands. Refs: remoteclaw/hq#35 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Production code no longer imports
pi-embedded.jsorpi-embedded-runner/runs.js— they were removed by prior gut commits (#2146/#2273, #2367, #2377). The 6vi.mockcalls identified in remoteclaw/hq#35 registered mock factories against paths nothing resolves; vitest never invoked them, and the mock state those tests configured had zero effect on production behavior.This PR deletes all 6 dead
vi.mockshims and the local state each one was paired with.Files touched
src/agents/subagent-announce.timeout.test.tsvi.mock("./pi-embedded.js", ...)(3-function shim)src/agents/subagent-announce.format.e2e.test.tsvi.mock("./pi-embedded.js", () => embeddedRunMock)only (see §Out of scope below)src/auto-reply/reply/abort.test.tsvi.mock("../../agents/pi-embedded.js", ...)(2-function shim)src/auto-reply/reply/get-reply-run.media-only.test.tsvi.mock("../../agents/pi-embedded.js", ...)(4-function shim)src/cli/gateway-cli/run-loop.test.tsvi.mock("../../agents/pi-embedded-runner/runs.js", ...)+ localabortEmbeddedPiRun/getActiveEmbeddedRunCount/waitForActiveEmbeddedRunsvi.fn()s + their setup calls in the SIGUSR1 restart test + obsolete commentsrc/cron/isolated-agent/run.test-harness.tsvi.mock("../../agents/pi-embedded.js", ...)+ exportedrunEmbeddedPiAgentMock+makeDefaultEmbeddedResult()helper + harness reset linesDiffstat: 6 files changed, 51 deletions, 0 additions.
Verification
grep -rn "vi.mock.*pi-embedded" src/returns 0 matches (was 6)pnpm lint: 0 warnings, 0 errorspnpm tsgo: exit 0pnpm test:fast: 761 files / 6829 passed / 2 skipped / 0 failedrun-loop.test.ts8/8 pass;src/cron/isolated-agent/118/118 passOut of scope
Four of the touched files have pre-existing failures unrelated to this PR (session routing, ACP cancel flow, think-level extraction, message content format). Pass/fail counts are identical before and after this change:
subagent-announce.timeout.test.tsabort.test.tsget-reply-run.media-only.test.tssubagent-announce.format.e2e.test.ts(e2e, excluded from CI)subagent-announce.format.e2e.test.tsstill references a deadembeddedRunMockobject throughout its body. Deleting those ~42 references would be a ~200-line refactor touching pre-existing-failing tests — deferred as out of scope.Follow-up
After this merges, HQ will ratchet
.claude/skills/fork-openclaw/SKILL.md§ Semantic Invariants § Test Infrastructure from "≤6 matches" back to "0 matches" to restore the stricter check (tracked alongside remoteclaw/hq#35).Test plan
pnpm lintcleanpnpm tsgocleanpnpm test:fast6829 passed / 0 failedpnpm test(parallel lanes) greenRefs: remoteclaw/hq#35
🤖 Generated with Claude Code