Skip to content

gut: drop orphan runEmbeddedPiAgent tests + stale LLM config doc refs (#2482)#2488

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/2482-audit-obsolete-llm-config
Apr 22, 2026
Merged

gut: drop orphan runEmbeddedPiAgent tests + stale LLM config doc refs (#2482)#2488
alexey-pelykh merged 1 commit intomainfrom
gut/2482-audit-obsolete-llm-config

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #2482.

RemoteClaw middleware delegates LLM execution to CLI agents (Claude/Gemini/Codex/OpenCode) — leftover scaffolding from the pre-fork embedded Pi engine still lingered in tests that were excluded from running anyway, and in docs that prompted for gutted concepts (thinking-level config, pi-embedded-runner, runEmbeddedPiAgent). This PR cleans both.

  • Orphan tests deleted (all excluded from vitest.unit.config.ts — never ran):
    • src/commands/agent.test.ts
    • src/auto-reply/reply.block-streaming.test.ts
    • src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts (e2e, 37/42 failed locally — all tests mocked a dead runEmbeddedPiAgent)
    • src/auto-reply/reply/agent-runner.media-paths.test.ts
  • Test cases rename: runEmbeddedPiAgentMock alias → runAgentMock in reply.triggers.trigger-handling.filters-usage-summary-*.cases.ts (live mock wired via ChannelBridge — assertions remain meaningful)
  • Zero-importer source deleted: src/agents/pi-embedded-helpers/failover-matches.ts (+ parent directory)
  • Test infra: scripts/test-parallel.mjs drops deleted + 4 non-existent .test.ts entries; .fork-boundary-mock-baseline 132 → 126 (decrease locked in)
  • Docs: 1 deleted (agent-loop.md, described pre-fork execution) + 18 modified to drop stale runEmbeddedPiAgent, pi-embedded-runner, and thinking-level config references

AC verification

  • grep -rn "runEmbeddedPiAgent" src/ → zero hits
  • grep -rn "runEmbeddedPiAgent" docs/ → only explanatory note in sdk-migration.md (pre-fork bridge has no RemoteClaw equivalent)
  • pnpm tsgo → clean
  • pnpm lint → clean
  • pnpm format → applied
  • Fork-integrity gates: stub-debt (126 == 126), zombie-imports, throwing-stub-callers, rebrand-leakage → all pass

Test plan

  • pnpm tsgo clean
  • pnpm lint clean
  • pnpm format clean
  • node scripts/check-stub-debt.mjs passes (126 == baseline 126)
  • node scripts/check-no-zombie-imports.mjs passes
  • node scripts/check-throwing-stub-callers.mjs passes
  • bash scripts/ci/check-rebrand-leakage.sh passes
  • Adversarial validation via fresh-context subprocess — verdict CLEAN
  • Polish via fresh-context subprocess — FINDINGS (9 additional docs) all addressed
  • CI: `build`, `test`, `lint`, `docs`, fork-integrity gates (pending)

LIVE smoke tests: PR does not touch `src/middleware/` runtime code, so `LIVE=1 pnpm test:live` not required per CLAUDE.md.

…#2482)

RemoteClaw middleware delegates LLM execution to CLI agents — leftover
scaffolding from the pre-fork embedded Pi engine still lingered in tests
that were excluded from running anyway, and in docs that prompted for
gutted concepts (thinking-level config, pi-embedded-runner, runEmbeddedPiAgent).

Tests (all excluded from vitest.unit.config.ts — never actually ran):
- Delete src/commands/agent.test.ts
- Delete src/auto-reply/reply.block-streaming.test.ts
- Delete src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts
  (e2e, 37/42 failed locally — all tests mocked a dead runEmbeddedPiAgent)
- Delete src/auto-reply/reply/agent-runner.media-paths.test.ts
- Rename stale runEmbeddedPiAgentMock alias → runAgentMock in
  src/auto-reply/reply.triggers.trigger-handling.filters-usage-summary-*.cases.ts
  (live mock wired via ChannelBridge — assertions remain meaningful)

Source/infra:
- Delete src/agents/pi-embedded-helpers/failover-matches.ts (zero importers)
- scripts/test-parallel.mjs: drop deleted + non-existent .test.ts entries
- .fork-boundary-mock-baseline: 132 → 126 (decrease locked in)

Docs — obsolete runEmbeddedPiAgent / pi-agent-core / pi-embedded-runner:
- Delete docs/concepts/agent-loop.md (described pre-fork execution path)
- docs/astro.config.mjs, docs/start/hubs.md, docs/automation/hooks.md:
  drop agent-loop cross-refs
- docs/help/testing.md: drop "Embedded runner note" pointing at
  non-existent pi-embedded-runner test paths
- docs/reference/session-management-compaction.md: describe current CLI
  subprocess compaction forwarding instead of ensurePiCompactionReserveTokens
- docs/plugins/sdk-migration.md: drop runEmbeddedPiAgent code example +
  resolveThinkingDefault table row; explain that the pre-fork bridge has
  no RemoteClaw equivalent and plugins should route via agent.send RPC

Docs — obsolete thinking-level references (#2480 gutted the surface):
- docs/concepts/system-prompt.md, context.md, reference/token-use.md:
  align Runtime metadata description with current code (channel/user/timezone)
- docs/automation/cron-jobs.md, cron-vs-heartbeat.md, webhook.md,
  docs/gateway/configuration-reference.md, configuration-examples.md,
  doctor.md: drop `thinking` payload field / migration enumeration entries
- docs/concepts/session-tool.md: drop thinking? param from sessions_spawn
- docs/concepts/session.md: /status shows verbose toggle only
- docs/start/remoteclaw.md: drop "thinking defaults" tuning bullet
- docs/concepts/messages.md, help/faq.md, start/hubs.md: drop broken
  /tools/thinking page links and the gutted /thinking directive
- docs/platforms/macos.md: drop `thinking` from remoteclaw://agent query params

AC verification:
- `grep -rn "runEmbeddedPiAgent" src/` → zero hits
- `grep -rn "runEmbeddedPiAgent" docs/` → only explanatory note in
  sdk-migration.md (pre-fork bridge has no RemoteClaw equivalent)
- pnpm tsgo → clean
- pnpm lint → clean
- pnpm format → applied
- Fork-integrity gates: stub-debt (126 == 126), zombie-imports,
  throwing-stub-callers, rebrand-leakage → all pass

Closes #2482.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh merged commit 7ac209a into main Apr 22, 2026
15 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/2482-audit-obsolete-llm-config branch April 22, 2026 21:44
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.

chore: audit tests and onboarding docs for obsolete LLM config references

1 participant