Skip to content

fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper (#136) - #137

Closed
KooshaPari wants to merge 1 commit into
masterfrom
fix/setup-hints-orphan-spawn-notice
Closed

KooshaPari wants to merge 1 commit into
masterfrom
fix/setup-hints-orphan-spawn-notice

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Deletes the StartupHints::with_spawn_notice associated function from crates/jcode-setup-hints/src/lib.rs. It is dead code — PR #128 removed the only call site, but the helper itself was left behind and now causes the Quality Guardrails CI check to fail with error: associated function \with_spawn_notice` is never used(implied by-D warnings`).

Root cause

with_spawn_notice is referenced NOWHERE on master except its own definition. The startup_spawn_hint_dismissed gate that used to invoke it always evaluated to None in practice, so PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice") removed all call sites but deliberately deferred the helper removal as a follow-up — recorded in docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md (~line 113). This PR is that follow-up.

Change

-    fn with_spawn_notice(message: String) -> Self {
-        Self {
-            auto_send_message: None,
-            status_notice: Some(message.clone()),
-            display_message: Some(("Launch".to_string(), message)),
-        }
-    }
-

Single function deleted, 8 lines removed, no other code touched.

What was NOT deleted (intentional)

Symbol Why kept
StartupHints::with_status_and_display Used in 7+ call sites in windows_setup.rs, lib.rs (hotkey hints, keybinding hints, etc.)
SetupHintsState::startup_spawn_hint_dismissed field Kept for serde Deserialize state-file compatibility — users may have false persisted
fn startup_hints_for_launch(_state) -> Option<StartupHints> Callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature
StartupHints::status_notice field NOT dead — read by src/cli/tui_launch.rs:244 and crates/jcode-setup-hints/src/setup_hints_tests.rs:272

Validation

  • cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings — exit 0, no warnings
  • cargo fmt -p jcode-setup-hints -- --check — exit 0
  • cargo test -p jcode-setup-hints --lib — same set of pre-existing platform-specific failures as origin/master (verified by re-running against master with the patch reverted). The one setup_hints_tests failure (first_three_launches_can_include_hotkey_notice_too) was already broken by PR refactor(setup-hints): remove unreachable startup spawn notice #128 and is out of scope here — it tests that startup_hints_for_launch returns Some(hint) on the third launch, which no longer happens. A separate fix is needed.

Ledger

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error

Closes #136


CodeAnt-AI Description

Remove the unused startup spawn notice helper

What Changed

  • Removes an unused startup notice helper; startup hint behavior is unchanged

Impact

✅ Setup-hints checks no longer report an unused-helper warning

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…per (#136)

PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice")
removed the only call site of `StartupHints::with_spawn_notice`, leaving the
helper as a dead-code associated function. The session doc
`docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md` (~line 113)
records this leftover as an explicit follow-up. The CI "Quality Guardrails"
check now fails with:

    error: associated function `with_spawn_notice` is never used
       --> crates/jcode-setup-hints/src/lib.rs:201:8

Delete the `with_spawn_notice` associated function entirely. No
`#[allow(dead_code)]` — the call path is gone, the function should go too.
Aggressive-change policy: remove, do not silence.

Preserved:
- `StartupHints::with_status_and_display` (used in 7+ call sites)
- `SetupHintsState::startup_spawn_hint_dismissed` (state-file serde compat)
- `fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>`
  (callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature)
- `StartupHints::status_notice` field — read by `src/cli/tui_launch.rs:244`
  and `crates/jcode-setup-hints/src/setup_hints_tests.rs:272`, NOT dead.

Validation:
- cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0
- cargo fmt -p jcode-setup-hints -- --check: exit 0
- cargo test -p jcode-setup-hints --lib: same pre-existing platform-specific
  failures as master; no new failures introduced. The one setup_hints_test
  failure (`first_three_launches_can_include_hotkey_notice_too`) was already
  broken by PR #128 and is out of scope here.

Closes #136

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error
Copilot AI balanced review requested due to automatic review settings October 19, 2026 20:55
@codeant-ai

codeant-ai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 19d11fb Oct 19, 2026 · 20:55 20:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 40cf2349-1827-468f-ae27-fcf41a11e046
📥 Commits

Reviewing files that changed from the base of the PR and between b988614 and 19d11fb.

📒 Files selected for processing: 1
  • crates/jcode-setup-hints/src/lib.rs
💤 Files with no reviewable changes: 1
  • crates/jcode-setup-hints/src/lib.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 14
  • GitHub Check: Require Linked Issue
  • GitHub Check: Macroscope - Correctness Check
  • GitHub Check: Build & Test (macos-latest)
  • GitHub Check: Windows Cross-Target Check (Linux)
  • GitHub Check: Build & Test (windows-latest)
  • GitHub Check: PowerShell Syntax
  • GitHub Check: Build & Test (ubuntu-latest)
  • GitHub Check: Quality Guardrails
  • GitHub Check: Release Automation
  • GitHub Check: Format
  • GitHub Check: TypeScript SDK
  • GitHub Check: Setup Friction Eval (Linux installer)
  • GitHub Check: Kilo Code Review
  • GitHub Check: semgrep-cloud-platform/scan
📝 Summary

Summary

The PR removes the unused StartupHints::with_spawn_notice helper. The linked issue confirms that the helper has no remaining call sites and that the related live API and serde-compatible field must remain. The inspected source still contains StartupHints::with_status_and_display.

Recommendation: Approve. The change matches the stated scope and does not suppress the dead-code warning.

Must Fix

None identified.

Should Fix

None identified.

Consider

The author reports that Clippy and formatting checks passed. The author also reports that library tests retain the same pre-existing failures as origin/master; these results were not independently verified here.

The change removes the unused private StartupHints::with_spawn_notice constructor from the setup-hints crate.

Changes: Setup hints cleanup

Layer / File(s) Summary
Remove the unused constructor
crates/jcode-setup-hints/src/lib.rs
Removes StartupHints::with_spawn_notice, which populated the status notice and “Launch” display message from the same input.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 19d11

No actionable risk from removing the unused helper is identified; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the deletion of the orphaned StartupHints::with_spawn_notice helper, which is the main change.
Description check Passed The description directly explains the unused helper, the dead-code warning, the intentional scope, and the validation results.
Linked Issues check Passed The whole-PR summary shows that PR #137 removes the private StartupHints::with_spawn_notice constructor from crates/jcode-setup-hints/src/lib.rs with 0 additions and 8 deletions. It reports no cha…
Out of Scope Changes check Passed The whole-PR summary reports one focused change: removal of the unused StartupHints::with_spawn_notice constructor. It reports no other code changes and no changes to public entities. The change is …
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The whole-PR summary shows that PR #137 removes the private StartupHints::with_spawn_notice constructor from crates/jcode-setup-hints/src/lib.rs with 0 additions and 8 deletions. It reports no changes to exported or public entities. This implements issue #136 without adding a dead-code suppression. The PR reports successful Clippy and formatting checks, and reports no new library-test failures compared with master.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary reports one focused change: removal of the unused StartupHints::with_spawn_notice constructor. It reports no other code changes and no changes to public entities. The change is within issue #136 scope.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches: 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai

codeant-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; the visible change only removes a private StartupHints constructor, with no concrete concern in the supplied code.

Assessed commit: 19d11fbeba33

@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • crates/jcode-setup-hints/src/lib.rs - 0 issues

Reviewed by free · Input: 47.5K · Output: 1.2K · Cached: 126.5K

@KooshaPari

Copy link
Copy Markdown
Owner Author

Superseded by #140 — do not merge

#140 (fix/setup-hints-pr128-test-regression) is a strict superset of this PR: it carries this branch's crates/jcode-setup-hints/src/lib.rs change plus the additional test-regression update that landed on top of it. Merging both would conflict on the same file.

Action requested from the operator: close this PR (#137) without merging. No content is lost — everything it contains is already in #140.

KooshaPari added a commit that referenced this pull request Nov 10, 2026
…ce_too to assert retired spawn-notice behavior (#139) (#140)

* fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper (#136)

PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice")
removed the only call site of `StartupHints::with_spawn_notice`, leaving the
helper as a dead-code associated function. The session doc
`docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md` (~line 113)
records this leftover as an explicit follow-up. The CI "Quality Guardrails"
check now fails with:

    error: associated function `with_spawn_notice` is never used
       --> crates/jcode-setup-hints/src/lib.rs:201:8

Delete the `with_spawn_notice` associated function entirely. No
`#[allow(dead_code)]` — the call path is gone, the function should go too.
Aggressive-change policy: remove, do not silence.

Preserved:
- `StartupHints::with_status_and_display` (used in 7+ call sites)
- `SetupHintsState::startup_spawn_hint_dismissed` (state-file serde compat)
- `fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>`
  (callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature)
- `StartupHints::status_notice` field — read by `src/cli/tui_launch.rs:244`
  and `crates/jcode-setup-hints/src/setup_hints_tests.rs:272`, NOT dead.

Validation:
- cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0
- cargo fmt -p jcode-setup-hints -- --check: exit 0
- cargo test -p jcode-setup-hints --lib: same pre-existing platform-specific
  failures as master; no new failures introduced. The one setup_hints_test
  failure (`first_three_launches_can_include_hotkey_notice_too`) was already
  broken by PR #128 and is out of scope here.

Closes #136

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error

* fix(setup-hints): update first_three_launches_can_include_hotkey_notice_too to assert retired spawn-notice behavior (#138)

PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice",
commit 081c1cf) retired the macOS launch-hotkey spawn notice. The function
`startup_hints_for_launch` now always returns `None`, with a comment
explaining the prior gate (`if !hotkey_configured || dismissed`) was
unreachable because the crate never wrote `startup_spawn_hint_dismissed = false`
(the field defaults to `true` in `SetupHintsState::default()`).

The test `first_three_launches_can_include_hotkey_notice_too` was always
broken — even before PR #128, its `hotkey_configured: true` state with
`..SetupHintsState::default()` produced `dismissed = true`, which would
short-circuit the gate to `None`. PR #128 itself acknowledged this in its
commit message ("the macOS test was already failing on master for an
unrelated reason — the test relies on a spawn notice that was dead code by
the time it was written").

Fix the test to assert the post-#128 behavior: `startup_hints_for_launch`
returns `None` regardless of `hotkey_configured` or
`startup_spawn_hint_dismissed`. Kept the `#[cfg(target_os = "macos")]`
gate so the test remains macOS-only, symmetric with other launch-hotkey
notice tests in this file. Updated the docstring to record the PR #128
provenance so the test's intent is obvious to future maintainers.

Also cherry-picks PR #137 (dead-code removal of `StartupHints::with_spawn_notice`)
onto this branch so the branch satisfies `cargo clippy ... -D warnings` —
that helper was the only `dead_code` warning in the crate, and PR #128's
test retirement leaves the crate with the warning active. Both commits are
required for clippy to pass.

Diff scope:
- crates/jcode-setup-hints/src/setup_hints_tests.rs: test body + docstring (+17/-11)
- crates/jcode-setup-hints/src/lib.rs (cherry-picked from PR #137): -8 lines

Validation:
- cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0
- cargo fmt -p jcode-setup-hints -- --check: exit 0
- cargo test -p jcode-setup-hints --lib setup_hints_tests::first_three_launches_can_include_hotkey_notice_too: ok
- cargo test -p jcode-setup-hints --lib: 144 passed, 5 failed; same 5 pre-existing
  platform-specific failures as on origin/master (linux_env x2, linux_niri x2,
  macos_launcher x1) — none caused by this change.

Closes #138

tx-agent:     jcode
tx-validated: test
tx-task:      #136
tx-scope:     jcode-setup-hints
tx-intent:    update PR #128 broken test to assert retired spawn-notice behavior
@KooshaPari

Copy link
Copy Markdown
Owner Author

Closing under the host-ops closure audit (2026-11-11): the same change already landed on master (matching commit subject); this PR is the leftover branch. The branch fix/setup-hints-orphan-spawn-notice is preserved on the remote, so the work is recoverable with git fetch origin fix/setup-hints-orphan-spawn-notice or by reopening this PR. Nothing was deleted.

@KooshaPari KooshaPari closed this Nov 11, 2026
@KooshaPari
KooshaPari deleted the fix/setup-hints-orphan-spawn-notice branch November 27, 2026 09:42
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.

fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper

2 participants