Skip to content

gut(auto-reply): delete dead buildEmbeddedRun* cluster in agent-runner-utils.ts (#2469)#2474

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/2469-dead-embedded-run-cluster
Apr 22, 2026
Merged

gut(auto-reply): delete dead buildEmbeddedRun* cluster in agent-runner-utils.ts (#2469)#2474
alexey-pelykh merged 1 commit intomainfrom
gut/2469-dead-embedded-run-cluster

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Closes #2469. Part of the #2336 umbrella sweep — peer of #2463 (Areas 1+2+4) and #2465 (adjacent auto-reply cleanup).

Summary

The 9 buildEmbeddedRun* / resolve* exports in agent-runner-utils.ts were Pi-embedded-runner plumbing with zero production callers — only self-tests. Deleting the cluster lets us trim five correspondingly-dead fields from FollowupRun.run and the assignment block in get-reply-run.ts that fed them.

Changes (net -598 lines across 8 files)

File Change
agent-runner-utils.ts Drop 9 dead exports; file shrinks to live error/usage helpers (isBunFetchSocketError, formatBunFetchSocketError, formatResponseUsageLine, appendUsageLine).
agent-runner-utils.test.ts Deleted — entire file was self-tests of the dead cluster.
queue/types.ts Drop verboseLevel, reasoningLevel, elevatedLevel, execOverrides, bashElevated from FollowupRun.run.
get-reply-run.ts Drop the dead assignment block (lines 439–447); keep resolvedVerboseLevel local since it still flows to runReplyAgent's tool-output gate.
followup-runner.ts Drop verboseLevel passthrough (field gone).
reply-plumbing.test.ts Drop orphaned describe("buildThreadingToolContext") block + unused imports.
test-helpers.ts, agent-runner.runreplyagent.e2e.test.ts Drop dead field setup on mock FollowupRun constructions; drop inert reasoningLevel runOverride (mock unconditionally fires onReasoningStream).

What stays load-bearing

  • Live verboseLevel consumer (agent-runner-execution.ts) reads params.resolvedVerboseLevel — passed independently, NOT through FollowupRun.run. Unaffected.
  • Session-store fields verboseLevel / reasoningLevel / elevatedLevel (load-bearing for display, security, ACP). Unaffected.
  • RunPreparedReplyParams in get-reply-run.ts keeps the upstream resolvedReasoningLevel / resolvedElevatedLevel / execOverrides / elevatedEnabled / elevatedAllowed params intact — caller-side cleanup is separate (Area 5 territory).

Verification

  • pnpm check → format + tsgo + lint + custom gates pass.
  • pnpm test → 7298 tests passed (3 skipped) across 817 files.
  • node scripts/check-throwing-stub-callers.mjs → 0 violations.
  • No new @ts-expect-error suppressions; stub-debt-gate clean.

Verification command (matches issue)

for sym in buildEmbeddedRunBaseParams buildEmbeddedContextFromTemplate buildEmbeddedRunContexts buildTemplateSenderContext resolveRunAuthProfile resolveEnforceFinalTag resolveProviderScopedAuthProfile resolveModelFallbackOptions buildThreadingToolContext; do
  git grep -l "$sym" -- 'src/**' | grep -v agent-runner-utils | grep -v "\.test\." || echo "$sym: 0 production callers"
done

Test plan

  • CI green (build + test + lint + docs + fork-integrity gates).
  • No regression in live verboseLevel plumbing — covered by existing agent-runner-execution tests + server-chat.agent-events.test.ts.

🤖 Generated with Claude Code

…r-utils.ts (#2469)

The 9 exports were Pi-embedded-runner plumbing with zero production
callers — only self-tests. Removing the cluster lets us trim five
correspondingly-dead fields from `FollowupRun.run` and the assignments
in `get-reply-run.ts` that fed them.

Deletions:
- agent-runner-utils.ts: drop buildThreadingToolContext,
  buildEmbeddedRunBaseParams, buildEmbeddedContextFromTemplate,
  buildEmbeddedRunContexts, buildTemplateSenderContext,
  resolveRunAuthProfile, resolveEnforceFinalTag,
  resolveProviderScopedAuthProfile, resolveModelFallbackOptions
  (file shrinks to live error/usage helpers).
- agent-runner-utils.test.ts: deleted (entire file was self-tests).
- queue/types.ts: drop verboseLevel/reasoningLevel/elevatedLevel/
  execOverrides/bashElevated from FollowupRun.run.
- get-reply-run.ts: drop the dead assignments; keep
  resolvedVerboseLevel local since it still flows to runReplyAgent's
  tool-output gate. (RunPreparedReplyParams surface unchanged —
  caller cleanup is separate area.)
- followup-runner.ts: drop verboseLevel passthrough (field gone).
- reply-plumbing.test.ts: drop orphaned buildThreadingToolContext
  describe block + unused imports.
- test-helpers.ts + agent-runner.runreplyagent.e2e.test.ts: drop dead
  field setup on mock FollowupRun constructions; drop inert
  reasoningLevel runOverride (mock unconditionally fires
  onReasoningStream).

Live verboseLevel consumer (agent-runner-execution.ts) reads
params.resolvedVerboseLevel, NOT FollowupRun.run.verboseLevel —
unaffected. Session-store verboseLevel/reasoningLevel/elevatedLevel
fields (load-bearing for display/security/ACP) — unaffected.

Net -598 lines across 8 files. pnpm check + pnpm test green;
throwing-stub-callers gate passes; no new @ts-expect-error
suppressions introduced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 22, 2026 15:08
@alexey-pelykh alexey-pelykh merged commit 4ec7a75 into main Apr 22, 2026
15 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/2469-dead-embedded-run-cluster branch April 22, 2026 15:14
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.

gut(auto-reply): delete dead buildEmbeddedRun* cluster in agent-runner-utils.ts (found during #2336 sweep)

1 participant