chore: remove three unused exports#16
Open
oratis wants to merge 1 commit into
Open
Conversation
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>
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 #15.
What
Three exports with zero callers anywhere in
src/:createAnthropicClient()src/llm.tsAnthropicProvideralready does internallyDEFAULT_MAX_TOKENSsrc/llm.tsreadOnlyToolNames()src/tools/task.tsSessionStore.readAll()src/sessions/store.tsBonus
Dropping
SessionStore.readAllremoves aJSON.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 currentreadMessagePagealready wraps each parse in try/catch, so the pattern was inconsistent.Removing
createAnthropicClientmakes theAnthropic+proxyAwareFetchimports insrc/llm.tsunused. The whole module collapses to one line:export const DEFAULT_MODEL = "claude-sonnet-4-6".Verification
After the diff: zero hits outside the test grep itself.
npm run typecheckclean.Scope
🤖 Generated with Claude Code