1jehuang / 1jehuang/jcode

Auto-resume of interrupted sessions has no opt-out, and stale recovery markers make it fire on finished sessions

Open
#1,000 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no bug enhancement triage: needs-decision
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

Ask

Add an opt-out for automatic resume of interrupted sessions. For example
[features] auto_resume_interrupted = false in ~/.jcode/config.toml, plus a
JCODE_AUTO_RESUME_INTERRUPTED env override.

Problem

When I resume a session, jcode often starts work at once, without a prompt from
me. It does this even for sessions that were already finished. There is no way
to turn this off.

The cause is the reload/crash recovery path, not auto-poke. My config has
auto_poke = false.

Evidence on my machine

A stale recovery record still sits in ~/.jcode/reload-recovery/:

{"reload_id":"reload_1786449647560_...","session_id":"session_ant_1786447268112_...",
 "role":"interrupted_peer","status":"pending",
 "directive":{"reconnect_notice":null,
 "continuation_message":"Your session was interrupted by a server reload while a tool was running. The tool was aborted and results may be incomplete. Continue exactly where you left off and do not ask the user what to do next."},
 "reason":"attached peer session running during reload",
 "created_at":"2026-08-11T12:00:47.562472306+00:00"}

The record is from 2026-08-11 and the status is still pending. A second stale
marker sits in ~/.jcode/pending-soft-interrupts/ from 2026-08-13.

The continuation message tells the model to continue and to not ask the user.
So the resume starts a turn with no input from me.

Two problems, one report

  1. No opt-out. /continue is the manual path. The automatic path has no
    flag. explicit_was_interrupted and inferred_was_interrupted decide, and
    the user cannot say no.
  2. Markers are not cleared. A crash leaves the record at status: pending.
    The session then looks interrupted forever. Resume fires again on each
    resume, days later.

Suggested fix

  • Add the config flag and the env override.
  • Clear or expire recovery records. A record that is days old is not a live
    interruption.
  • Optional: on resume of an interrupted session, show a one-line prompt and let
    the user press a key, instead of starting the turn.

Version

jcode v0.78.0 (2f7e3bcc6), Linux x86_64.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the reload/crash recovery path, including records under ~/.jcode/reload-recovery/ and ~/.jcode/pending-soft-interrupts/, and inspect how explicit_was_interrupted and inferred_was_interrupted trigger resume. Done means the config flag and environment override can disable automatic resume, while stale recovery markers no longer retrigger it; add or update tests for both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.