Repository navigation
fix(cli): name kcode in every resume hint, not jcode - #319
KooshaPari wants to merge 1 commit into
Conversation
A `jcode --resume` hint sends the operator to upstream jcode, which reads `~/.jcode` instead of `~/.kcode`, so the session they were told to resume is not in that store. afbf7e6 fixed part of this on `fix/a25-terminal-restore`, but master still emitted the literal in nine places and its own `single_session_hint_also_points_at_the_picker` test pinned the `jcode` picker line, so the test was red on master. Add `resume_binary_stem()` (= "kcode", identical to afbf7e6 so the two merge trivially) and route every emitted resume hint through it: the four crash-hint lines and `write_session_resume_hint` in terminal.rs, the post-merge resume line in cloud_move.rs, the restore-session hint in startup.rs, the manual-resume line in tui_launch.rs, and the dispatch resume failure hint. The picker test now asserts against the helper instead of the literal. Tests: `cargo test -p kcode --lib -- resume picker hint` 17 passed, 0 failed; `cargo check -p kcode` clean; `cargo fmt --check` clean (all on nixos). Refs #30 tx-agent: jcode tx-validated: test tx-lane: jcode:session_dromedary_1795252699395_0e7b881276cc3881
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
| /// part of the "sessions on reload have issues" report. Matches | ||
| /// `ssh::resume_hint`, which already names the kcode binary. | ||
| pub(crate) fn resume_binary_stem() -> &'static str { | ||
| "kcode" |
There was a problem hiding this comment.
SUGGESTION: Single source of truth for the resume-hint binary name
ssh::resume_hint (src/cli/ssh.rs:136) still hardcodes its own "kcode" literal rather than calling this helper. Now that resume_binary_stem() exists as the canonical name used by every other resume hint, routing ssh::resume_hint through it too would prevent the two from silently drifting if the binary name ever changes. Non-blocking — this PR is correct as-is.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Merge with notes Overview
This PR is a clean, mechanical fix: every emitted Issue Details (click to expand)SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 41.9K · Output: 5.7K · Cached: 595.7K |
|
| output::stderr_info(format!( | ||
| " {} --resume {}", | ||
| crate::cli::terminal::resume_binary_stem(), | ||
| session_id | ||
| )); |
There was a problem hiding this comment.
Suggestion: For a resumed SSH session, session_id identifies a remote session, but this prints a local-only command; kcode --resume cannot reconnect to that host.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Incomplete implementation
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** src/cli/startup.rs
**Line:** 565:569
**Comment:**
*Incomplete Implementation: For a resumed SSH session, `session_id` identifies a remote session, but this prints a local-only command; `kcode --resume` cannot reconnect to that host.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix#322) * fix(cli): name kcode in every resume hint, not jcode A `jcode --resume` hint sends the operator to upstream jcode, which reads `~/.jcode` instead of `~/.kcode`, so the session they were told to resume is not in that store. afbf7e6 fixed part of this on `fix/a25-terminal-restore`, but master still emitted the literal in nine places and its own `single_session_hint_also_points_at_the_picker` test pinned the `jcode` picker line, so the test was red on master. Add `resume_binary_stem()` (= "kcode", identical to afbf7e6 so the two merge trivially) and route every emitted resume hint through it: the four crash-hint lines and `write_session_resume_hint` in terminal.rs, the post-merge resume line in cloud_move.rs, the restore-session hint in startup.rs, the manual-resume line in tui_launch.rs, and the dispatch resume failure hint. The picker test now asserts against the helper instead of the literal. Tests: `cargo test -p kcode --lib -- resume picker hint` 17 passed, 0 failed; `cargo check -p kcode` clean; `cargo fmt --check` clean (all on nixos). Refs #30 tx-agent: jcode tx-validated: test tx-lane: jcode:session_dromedary_1795252699395_0e7b881276cc3881 * refactor(cli): extract resume_hint helper to keep budgets green The picker-resume fix routed every hint through resume_binary_stem(), which expanded the multi-line format! calls in four call sites. cloud_move.rs is already over the size budget, so the literal fix grew it past the ratchet. Add `terminal::resume_hint(session_id) -> String` and render every `<bin> --resume <id>` instruction through it. cloud_move.rs is flat at 1705 LOC, and the swallowed-error budget stays improved. tx-agent: jcode tx-validated: lint tx-lane: jcode:session_guppy_1795259779712_9d08770945f44d0c



User description
Every resume hint must name
kcode. A hint that saysjcode --resume <id>tells the operator to run upstream jcode, which reads~/.jcodeinstead of~/.kcode, so the session they were told to resume is not in that store; it is the same defect class as the "sessions on reload have issues" report. Commitafbf7e658(onfix/a25-terminal-restore) addedresume_binary_stem()and fixed part of this, but master still emitted the literal in nine places, and master's ownsingle_session_hint_also_points_at_the_pickertest pinned thejcodepicker line, so that test was red on master.This PR adds the identical
resume_binary_stem() -> "kcode"helper (same body asafbf7e658, so the two merge without conflict) and routes every emitted hint through it:src/cli/terminal.rs- the fourcrash_resume_hint_linesforms (single-session resume, "Or browse all", multi-session resume, "List all") and thewrite_session_resume_hintfallbacksrc/cli/cloud_move.rs- the post-merge "Resume:" linesrc/cli/startup.rs- the "To restore this session, run:" hintsrc/cli/tui_launch.rs- the manual resume line printed when no terminal emulator is foundsrc/cli/dispatch.rs- the resume-resolution failure hintThe picker test now asserts against the helper instead of a literal, so it cannot pin the wrong binary again. Comments and doc comments that mention
jcode --resumeas prose were deliberately left alone.Verification on nixos (
PKG_CONFIG_PATHfromnixpkgs#openssl.dev, since nbuild does not forward it):cargo test -p kcode --lib -- resume picker hint-> 17 passed, 0 failed (includes the previously-redsingle_session_hint_also_points_at_the_picker)cargo check -p kcode-> cleancargo fmt --checkon the five touched files -> cleanRefs #30
CodeAnt-AI Description
Show the correct command for resuming sessions
What Changed
kcode --resume.kcode.Impact
✅ Resume commands find sessions in the kcode store✅ Crash recovery points to the correct app✅ Manual resume instructions work when no terminal is available💡 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:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
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:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
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.