refactor(coding-agent): remove the test-only daemon-lookup seam from main.ts - #1738
Closed
snimu wants to merge 7 commits into
Closed
refactor(coding-agent): remove the test-only daemon-lookup seam from main.ts#1738snimu wants to merge 7 commits into
snimu wants to merge 7 commits into
Conversation
…e-daemon-lookup-fake
…e-daemon-lookup-fake
…e-daemon-lookup-fake
…e-daemon-lookup-fake
…e-daemon-lookup-fake
This was referenced Aug 27, 2026
Contributor
Author
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.
What was wrong
main.ts's interactive-startup wrapper accepted an optional injected daemon-lookup function that only three unit tests ever passed — a test-only seam in production code. Those tests asserted the wrapper's own try/catch branches through the fake, i.e. they restated the implementation (audit: test-only production code, test-only.md finding 5).The fix
+2/−48: the lookup type and option are deleted,
findActiveDaemonSessionSummaryis called directly, the three fake-lookup tests and their import are gone, and the function's now-unimportedexportkeyword is dropped. The realfallbackOnErrorpolicy and its production caller are byte-identical.How it's verified
Reviewer confirmed no other caller passed the option, the deleted tests covered no user-relevant obligation, and the remaining 52 routing tests pass. tsgo/biome clean; full CI-style suite failure set identical to stack base (two unrelated full-load flakes pass focused on both branches). Two-model implement/review loop, approved first pass.
Stacked on #1737 (test the whole stack at the leaf; merge base-first).
Note: intentionally no Linear ticket for this cleanup stack, so that check stays red.
Note
Low Risk
Internal refactor with no change to production lookup or error-fallback policy; only breaks out-of-tree imports of the formerly exported wrapper.
Overview
Removes the test-only injection point for interactive startup daemon active-session lookup: the optional
lookupcallback and its type alias are deleted, andfindActiveDaemonSessionSummaryForInteractiveStartupalways callsfindActiveDaemonSessionSummarydirectly.The wrapper is now internal (no longer exported).
fallbackOnErrorbehavior and the production caller that passes{ fallbackOnError: !publicCommand.attachAgent }are unchanged.Three unit tests that stubbed
lookupto exercise the wrapper’s try/catch are removed; remaining routing tests still cover the exported decision helpers.Reviewed by Cursor Bugbot for commit e290652. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Remove test-only daemon-lookup override seam from
main.tsRemoves the
ActiveDaemonSessionSummaryLookuptype alias and the optionallookupproperty fromActiveDaemonSessionSummaryLookupOptionsin main.ts. The functionfindActiveDaemonSessionSummaryForInteractiveStartupis no longer exported and always callsfindActiveDaemonSessionSummarydirectly. Deletes three tests in main-interactive-routing.test.ts that depended on injecting a custom lookup.findActiveDaemonSessionSummaryForInteractiveStartupis now internal; any out-of-tree importers will break. Thelookupoption is silently ignored if still passed.Macroscope summarized e290652.
Linear ticket: ENG-5658
(ticket linked above)