Skip to content

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

@alexey-pelykh

Description

@alexey-pelykh

Discovered during #2336 sweep (PR #2463). Not part of the issue AC — filing as dedicated follow-up.

Finding

The following exports in `src/auto-reply/reply/agent-runner-utils.ts` have zero production callers — dead Pi-embedded plumbing, only self-tested:

  • `buildEmbeddedRunBaseParams` (line ~171)
  • `buildEmbeddedContextFromTemplate` (line ~203)
  • `buildEmbeddedRunContexts` (line ~249)
  • `buildTemplateSenderContext`
  • `resolveRunAuthProfile`
  • `resolveEnforceFinalTag`
  • `resolveProviderScopedAuthProfile`
  • `resolveModelFallbackOptions`
  • `buildThreadingToolContext`

Verification: `git grep -l "" -- 'src/**' | grep -v agent-runner-utils | grep -v "\.test\."` returns 0 hits for each.

Consumers of these via `FollowupRun.run.{verboseLevel, reasoningLevel, elevatedLevel, execOverrides, bashElevated}` are also dead — only the dead cluster reads these fields. The live usage of `verboseLevel` (tool-output gating in `agent-runner-helpers.ts`) reads directly from the session store, NOT from `FollowupRun.run`.

Scope

  • Delete the 9 dead functions in `agent-runner-utils.ts`.
  • Delete their self-tests in `agent-runner-utils.test.ts`.
  • Remove `verboseLevel` / `reasoningLevel` / `elevatedLevel` / `execOverrides` / `bashElevated` from `FollowupRun.run` type in `src/auto-reply/reply/queue/types.ts`.
  • Remove corresponding assignments in `get-reply-run.ts` (`verboseLevel: resolvedVerboseLevel`, etc.) — keep `resolvedVerboseLevel` local since it flows to agent-runner tool-output gate.
  • Keep `verboseLevel` / `reasoningLevel` / `elevatedLevel` as session-store fields (load-bearing for display / security / ACP surfaces).
  • Keep `resolveOriginMessageTo` and `resolveRunModelFallbacksOverride` (3 and 1 production consumers respectively).

Related follow-ups

AC

  • All 9 dead functions + their self-tests deleted.
  • `FollowupRun.run` trimmed of dead fields.
  • `pnpm check` + `pnpm test` pass.
  • No new stub-debt / type suppressions introduced.

Context

Discovered in PR #2463 while tracing `resolvedVerboseLevel` / `resolvedReasoningLevel` / `resolvedElevatedLevel` consumption — the answer is "only via a dead function cluster." Filing separately to keep PR #2463 scoped to thinking-specific removals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions