gut: eliminate callers and delete ~20 EXCLUDE-STUB files in src/agents/#2377
Merged
alexey-pelykh merged 2 commits intomainfrom Apr 16, 2026
Merged
gut: eliminate callers and delete ~20 EXCLUDE-STUB files in src/agents/#2377alexey-pelykh merged 2 commits intomainfrom
alexey-pelykh merged 2 commits intomainfrom
Conversation
d98090e to
6664b8d
Compare
…s/ (#2367) Delete 20 EXCLUDE-STUB files and their test file (failover-error.test.ts), eliminate all import callers across 33 source and test files, and remove the now-empty pi-embedded-runner/ directory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6664b8d to
8e0cc0c
Compare
Three security audit test cases and the entire tts summarizeText describe
block depended on deleted EXCLUDE-STUB agent code (sandbox.ts config
resolver, embedded Pi model runner). With those stubs gone, the production
code either returns a hardcoded gutted config or throws unconditionally —
so the affected assertions can no longer exercise meaningful behavior.
- src/security/audit.test.ts:
- "scores small-model risk" — drop the "sandbox=all → info" case
(resolveSandboxConfigForAgent now always returns mode="off")
- "checks sandbox docker mode-off findings with/without agent override"
→ rename to "flags sandbox docker config when mode is off" and drop
the agent-override case (same gutted resolver)
- "checks sandbox browser bridge-network restrictions" — delete
(gutted resolver returns browser.enabled=false unconditionally)
- src/tts/tts.test.ts:
- Delete the summarizeText describe block and its associated mocks
(summarizeText now always throws; embedded model runner was removed)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
alexey-pelykh
added a commit
that referenced
this pull request
Apr 17, 2026
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>
5 tasks
alexey-pelykh
added a commit
that referenced
this pull request
Apr 17, 2026
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
src/agents/and 1 test file (failover-error.test.ts)pi-embedded-runner/directoryEXCLUDE-STUBtoEXCLUDE-GUTCloses #2367
Stubs deleted
pi-embedded-runner/{model,run/params,runs}.ts,pi-embedded.ts,pi-embedded-runner.ts,auth-profiles/session-override.ts,bash-tools.ts,bootstrap-budget.ts,bootstrap-cache.ts,cli-runner.ts,context-window-guard.ts,failover-error.ts,identity-file.ts,model-fallback.ts,sandbox.ts,skills-status.ts,skills.ts,stream-message-shared.ts,system-prompt.ts,test-helpers/usage-fixtures.tsCaller elimination strategy
any): inlined replacement types at call sitesrunWithModelFallback+runEmbeddedPiAgent): replaced with no-op + logvi.mockblocks, added local stubs where neededTest plan
pnpm checkpasses (format + typecheck + lint)pnpm testpasses (730 test files, 6420+ tests)🤖 Generated with Claude Code