Skip to content

refactor: remove dead functions and the never-written recovery hint read - #63

Open
KazKozDev wants to merge 1 commit into
mainfrom
chore/remove-dead-code
Open

KazKozDev wants to merge 1 commit into
mainfrom
chore/remove-dead-code

Conversation

@KazKozDev

Copy link
Copy Markdown
Owner

What this changes

Removes 253 lines that nothing calls. No behaviour changes, except that a retried step no longer runs an IndexedDB query whose result was always empty.

  • 15 functions with no references anywhere in the code, scripts or tests:
    • cdpPressAndHold
    • summarizeCall, snapshotSignature
    • downloadJson, downloadPdfViaPrint
    • sha256Hex, onSWEvent
    • anySubtasksPending, getCurrentSubtask, getSubtaskResult, skillPromptForSubtask
    • isInterrupted, retryPromptForStep
    • learnRecovery, clearMemory
  • getRecoveryHint and its call in agent-loop.ts. Its only writer, learnRecovery, was never called, so the recoveryMemory table stayed empty.
  • The recoveryMemory table stays declared in storage.ts, with a comment, so existing databases don't need a schema migration.

Why

Found by an audit with knip (unused exports), filtered to definitions with no references at all. Exports that are used inside their own file are a separate PR.

How it was verified

  • ./scripts/check.sh passes locally (419 unit tests, lint, typecheck, knip, smoke tests, build)

Reviewer notes

  • scripts/bridge-p0-live.mjs and bridge-p1-p2-live.mjs are no longer referenced anywhere, but this PR keeps them. They hold 32 live acceptance checks that bridge-tools-live.mjs does not cover.
  • If recovery learning was meant to ship, the fix is to call learnRecovery after a successful retry, not to delete it. This PR treats it as unfinished.

Checklist

  • One concern per PR
  • Commit messages follow Conventional Commits
  • No docs or CHANGELOG change needed

Security-sensitive areas

  • None of the above

🤖 Generated with Claude Code

Fifteen functions with no reference anywhere in the code, scripts or
tests: cdpPressAndHold, summarizeCall, snapshotSignature, downloadJson,
downloadPdfViaPrint, sha256Hex, onSWEvent, anySubtasksPending,
getCurrentSubtask, getSubtaskResult, skillPromptForSubtask, isInterrupted,
retryPromptForStep, learnRecovery and clearMemory.

learnRecovery was the only writer of recoveryMemory, so getRecoveryHint
always came back empty while still querying IndexedDB on every retried
step. The read and its call site go too. The Dexie table stays declared
so existing databases keep a valid schema without a migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-22T10:11:39.727703Z
We couldn’t complete this review. Comment @codex review to try again.
801cb33 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

KazKozDev added a commit that referenced this pull request Nov 22, 2026
Co-Authored-By: Claude Opus 5.5 <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.

1 participant