Skip to content

chore: remove three unused exports#16

Open
oratis wants to merge 1 commit into
mainfrom
chore/remove-unused-exports-15
Open

chore: remove three unused exports#16
oratis wants to merge 1 commit into
mainfrom
chore/remove-unused-exports-15

Conversation

@oratis
Copy link
Copy Markdown
Owner

@oratis oratis commented May 20, 2026

Closes #15.

What

Three exports with zero callers anywhere in src/:

Removed From Notes
createAnthropicClient() src/llm.ts Duplicates the work AnthropicProvider already does internally
DEFAULT_MAX_TOKENS src/llm.ts Declared but never imported; providers hardcode `16_000` inline
readOnlyToolNames() src/tools/task.ts Returns a hardcoded `Set(["read","grep","ls"])`; never called
SessionStore.readAll() src/sessions/store.ts Sibling `readMessagePage()` is the one in use (web/server.ts)

Bonus

Dropping SessionStore.readAll removes a JSON.parse(line) path with no try/catch — a single partial JSONL write (e.g. crash mid-append) would have made the whole call throw. The current readMessagePage already wraps each parse in try/catch, so the pattern was inconsistent.

Removing createAnthropicClient makes the Anthropic + proxyAwareFetch imports in src/llm.ts unused. The whole module collapses to one line: export const DEFAULT_MODEL = "claude-sonnet-4-6".

Verification

grep -rn "createAnthropicClient\|DEFAULT_MAX_TOKENS\|readOnlyToolNames\|\.readAll(" src/ --include="*.ts"

After the diff: zero hits outside the test grep itself.

npm run typecheck clean.

Scope

  • Three files, −30 lines net
  • Pure deletions, no replacement code
  • No public API change (these weren't documented or used externally), no behavior change

🤖 Generated with Claude Code

A grep across src/ surfaced three exports with no callers anywhere:

- src/llm.ts:
    * createAnthropicClient() — duplicates what AnthropicProvider
      already does internally; never invoked
    * DEFAULT_MAX_TOKENS — declared but never imported; providers
      hardcode 16_000 inline
    * with both gone the file's Anthropic + proxyAwareFetch imports
      become unused too, so the whole module collapses to a single
      DEFAULT_MODEL export

- src/tools/task.ts: readOnlyToolNames() — hardcoded Set returning
  ["read","grep","ls"]; never called

- src/sessions/store.ts: SessionStore.readAll() — sibling
  readMessagePage() handles all current readers (web/server.ts).
  As a bonus, this removes a JSON.parse-without-try/catch path that
  would have made a single corrupt JSONL line fatal.

Pure deletions, no replacement code. typecheck stays clean.

Closes #15

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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: remove three unused exports surfaced by dead-code scan

1 participant