Repository navigation
feat(tui): poke-context command surface - #381
KooshaPari wants to merge 3 commits into
Conversation
Add /poke <subcommand> variants that let users recover context
mid-session without leaving the current TUI:
/poke on|off|status — enable/disable/query automatic context
refresh on user-input turn boundaries
(existing behavior, now without the bare
/poke trigger form)
/poke repo-name — stage a 'resume from <repo>' prompt and
launch a fresh local session with it
/poke jcode — stage a 'resume from jcode' prompt and
launch a fresh local session with it
/poke all — alias for repo-name
/poke <anything-else> — falls through to the existing
'resume in new session' dispatcher
Implementation:
- New module commands_poke_context.rs (118 LoC) owns scope
parsing, prompt building, and the new-session launch. Kept
outside commands.rs so the existing handle_session_command
surface stays under the 350-LoC decomposition target.
- commands.rs now imports the new module and delegates
/poke <scope> before falling through to PokeCommand::On.
The bare /poke (no scope) form is removed to avoid ambiguity
with the new context-recovery semantics.
- commands_dispatch.rs rejects any /poke variant over SSH
except on/off/status (the new-session launch is local-only).
- input_help.rs and state_ui_input_helpers.rs updated to
advertise the new subcommands and the deprecated bare form.
- remote/key_handling.rs routes the new context-recovery
command to a new remote session and preserves the
user-attached image set across the SplitResponse.
Tests:
- Existing state_model_poke_03 and remote_events_reload_02
tests updated to use the new /poke on form (the bare form
is no longer accepted).
- New remote_events_reload_04::test_remote_poke_context_
preserves_prompt_and_attached_images verifies that the
staged prompt reaches the new session and the attached
images are preserved through the SplitResponse cycle.
tx-agent: jcode
tx-validated: cargo-check
tx-task: pr-25
tx-scope: crates/jcode-tui/src/tui/app/{commands,commands_dispatch,commands_poke_context,input_help,state_ui_input_helpers,remote/key_handling}.rs + tests
tx-intent: surface PR #25's /poke context-recovery feature into master
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou'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. View limit details
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. |
| }; | ||
| format!( | ||
| "You were started by `/poke` in a fresh Jcode session to recover the operator's active work context and continue safely. Scope: {scope}.\n\n\ | ||
| First recover context before acting: read the global memory registry and its relevant entries under `~/.jcode/memories/global/`; read relevant project memories for the scoped repositories; inspect this session's recent conversation history with `conversation_search` (stats, then recent turns and relevant prior requests). Treat the latest user instruction as authoritative and preserve prior constraints.\n\n\ |
There was a problem hiding this comment.
Custom agent: Impeccable Design Review (Beta)
Suggestion: Direct context recovery to the supported global-memory store or memory tools instead of this directory.
Severity Level: Major Ui
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-tui/src/tui/app/commands_poke_context.rs
**Line:** 41:41
**Comment:**
*Ui: Direct context recovery to the supported global-memory store or memory tools instead of this directory.
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
|
| RegisteredCommand::hidden("/clear-view", "Alias for /cls"), | ||
| RegisteredCommand::public("/rewind", "Rewind conversation to previous message"), | ||
| RegisteredCommand::public("/poke", "Poke model to resume with incomplete todos"), | ||
| RegisteredCommand::public("/poke", "Start a fresh session with recovered project context"), |
There was a problem hiding this comment.
Suggestion: The hand-written /help entry suppresses this description, so users are told bare /poke resumes todos even though it launches a fresh context session.
Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Comment mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-tui/src/tui/app/state_ui_input_helpers.rs
**Line:** 135:135
**Comment:**
*Comment Mismatch: The hand-written `/help` entry suppresses this description, so users are told bare `/poke` resumes todos even though it launches a fresh context session.
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| }; | ||
| format!( | ||
| "You were started by `/poke` in a fresh Jcode session to recover the operator's active work context and continue safely. Scope: {scope}.\n\n\ | ||
| First recover context before acting: read the global memory registry and its relevant entries under `~/.jcode/memories/global/`; read relevant project memories for the scoped repositories; inspect this session's recent conversation history with `conversation_search` (stats, then recent turns and relevant prior requests). Treat the latest user instruction as authoritative and preserve prior constraints.\n\n\ |
There was a problem hiding this comment.
Suggestion: The prompt points to ~/.jcode/memories/global/, but global memories are stored in memory/global.json; following this instruction misses the registered memories.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Logic error
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-tui/src/tui/app/commands_poke_context.rs
**Line:** 41:41
**Comment:**
*Logic Error: The prompt points to `~/.jcode/memories/global/`, but global memories are stored in `memory/global.json`; following this instruction misses the registered memories.
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| "/poke context launch is unavailable while disconnected from the Jcode server. Reconnect and try again.".to_string(), | ||
| )); | ||
| } else { | ||
| match super::launch_prompt_in_new_session_local(app, prompt, Vec::new()) { |
There was a problem hiding this comment.
Suggestion: When a local /poke command has attached images, this passes none to the child session, so the images are unavailable there.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Incomplete implementation
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-tui/src/tui/app/commands_poke_context.rs
**Line:** 60:60
**Comment:**
*Incomplete Implementation: When a local `/poke` command has attached images, this passes none to the child session, so the images are unavailable there.
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| let prepared = input::PreparedInput { | ||
| raw_input: trimmed.to_string(), | ||
| expanded: prompt, | ||
| images: prepared.images, |
There was a problem hiding this comment.
CRITICAL: Compile error — prepared.images references prepared inside its own initializer. A let binding is not in scope within its own initializer, so this fails cargo check/cargo build and blocks cargo test --workspace.
Pass the app's pending images instead (launch_prompt_in_new_session_local accepts Vec<(String, String)> and app.pending_images holds them):
| images: prepared.images, | |
| images: app.pending_images.clone(), |
|
Parked as a draft by the closure gate D1.5 sweep: mergeStateStatus is DIRTY, so the PR is not mergeable yet. The gate counts every open non-draft PR as owing a decision, and a draft records that decision honestly instead of leaving it ambiguous. Mark ready when the blocking condition clears. |



User description
Salvage
This branch was found during the 2026-11-27 branch-retirement pass and is
not contained in
master. It is opened here so the work is reviewable anddoes not silently rot as a remote ref.
Evidence it is not redundant (all three must hold; see
host-ops/kcode-branch-retirement):git merge-tree --write-tree origin/master origin/feature/pr-25-poke-contextproduces a tree thatdiffers from
origin/master(so merging it changes master).origin/master's historyof the paths it touches.
Size: 9 file(s), 9 files changed, 211 insertions(+), 16 deletions(-).
Review this as a normal contribution. It is not auto-merged, and the branch is
kept until someone decides.
Recovery/identity: the branch is
feature/pr-25-poke-contextat35ebbb0c0ea2d4d4654e55719c3c0ccea65deb36.tx-agent: jcode
CodeAnt-AI Description
Start a fresh session to recover project context with
/pokeWhat Changed
/poke <repo-name>starts a fresh session to recover context for one repository;/pokeand/poke allcover all active repositories./poke on,/poke off, and/poke statuscontinue to control automatic todo follow-ups. Remote context launches retain attached images.Impact
✅ Recover prior work without restating context✅ Limit recovery to one or all active repositories✅ Keep attached images when opening a remote session💡 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.