Skip to content

audit(agents): inventory throwing-stubs-with-live-callers across src/ #2409

@alexey-pelykh

Description

@alexey-pelykh

Summary

Inventory all (..._args: unknown[]): never throwing stubs across src/ and classify live-caller status. Sibling to #2337 (which covers silent-neuter stubs: => false, => {}, => []). This audit targets the unconditional-throw variant that shipped in #2408.

Rationale

The resolveAgentRuntimeOrThrow regression (#2408) is one instance of a class: a stub replaced with an unconditional throw during upstream sync, left with live production callers, passing CI because tests mock the stub. #2337 documents the related silent-neuter class — 3 files with hidden runtime regressions (Telegram vision, node-host skills, TUI listModels). Neither #2337 nor #2406 enumerates the throwing-stub variant. Likelihood other instances exist: moderate — the pattern is grep-able.

Scope

Enumerate all exports whose body is an unconditional throw, matching any of:

# Pattern A: explicit never-return stub with variadic unknown args
rg --type ts 'function\s+\w+\([^)]*\.\.\._?args:\s*unknown\[\][^)]*\):\s*never\s*\{' src/

# Pattern B: any "is not available in RemoteClaw fork" throw
rg --type ts 'throw new Error\("[^"]*is not available in RemoteClaw fork[^"]*"\)' src/

# Pattern C: stubs throwing "gutted" / upstream-compat messages
rg --type ts -B 2 'throw new Error\("[^"]*(gutted|upstream-compat)[^"]*"\)' src/

For each matching symbol:

  • Identify live callers via rg --type ts "\b<symbol>\b" src/ extensions/ excluding *.test.ts, *.test-helpers.ts, test-helpers/**, *.test-mocks.ts, *.test-utils.ts.
  • Classify:

Deliverable

A comment on this issue containing:

  1. Grep commands and their raw output.
  2. Classification table per stub: symbol | file:line | live callers (count + first 3 locations) | class a/b/c | disposition.
  3. Triage: class-c findings filed as separate fix issues, added to gut: re-apply provider/model cascade after v2026.3.7 sync regression (~19 files) #2337 scope if same sync origin, or bundled here if trivial count.
  4. Class-a/b findings documented but not necessarily acted on in this issue.

Acceptance criteria

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions