gut(auto-reply): delete dead buildEmbeddedRun* cluster in agent-runner-utils.ts (#2469)#2474
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
…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>
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.
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 inagent-runner-utils.tswere Pi-embedded-runner plumbing with zero production callers — only self-tests. Deleting the cluster lets us trim five correspondingly-dead fields fromFollowupRun.runand the assignment block inget-reply-run.tsthat fed them.Changes (net -598 lines across 8 files)
agent-runner-utils.tsisBunFetchSocketError,formatBunFetchSocketError,formatResponseUsageLine,appendUsageLine).agent-runner-utils.test.tsqueue/types.tsverboseLevel,reasoningLevel,elevatedLevel,execOverrides,bashElevatedfromFollowupRun.run.get-reply-run.tsresolvedVerboseLevellocal since it still flows torunReplyAgent's tool-output gate.followup-runner.tsverboseLevelpassthrough (field gone).reply-plumbing.test.tsdescribe("buildThreadingToolContext")block + unused imports.test-helpers.ts,agent-runner.runreplyagent.e2e.test.tsFollowupRunconstructions; drop inertreasoningLevelrunOverride (mock unconditionally firesonReasoningStream).What stays load-bearing
verboseLevelconsumer (agent-runner-execution.ts) readsparams.resolvedVerboseLevel— passed independently, NOT throughFollowupRun.run. Unaffected.verboseLevel/reasoningLevel/elevatedLevel(load-bearing for display, security, ACP). Unaffected.RunPreparedReplyParamsinget-reply-run.tskeeps the upstreamresolvedReasoningLevel/resolvedElevatedLevel/execOverrides/elevatedEnabled/elevatedAllowedparams 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.@ts-expect-errorsuppressions; stub-debt-gate clean.Verification command (matches issue)
Test plan
verboseLevelplumbing — covered by existingagent-runner-executiontests +server-chat.agent-events.test.ts.🤖 Generated with Claude Code