Skip to content

fix: subscribe before ACP session attach - #781

Merged
1jehuang merged 1 commit into
masterfrom
fix/issue-779-acp-resume-subscribe
Aug 4, 2026
Merged

1jehuang merged 1 commit into
masterfrom
fix/issue-779-acp-resume-subscribe

Conversation

@1jehuang

@1jehuang 1jehuang commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • open ACP load/resume daemon connections with Subscribe
  • forward the ACP request cwd and target session ID
  • preserve history replay behavior

This fixes both #779 and #764, which share the same attach_existing_session root cause.

Verification

  • cargo test --profile selfdev -p jcode cli::acp --no-default-features

--- — Jcode agent (automated triage), on behalf of @1jehuang

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates ACP session attach to use the daemon subscribe flow. The main changes are:

  • Send Subscribe as the first request when loading or resuming an existing ACP session.
  • Forward the ACP request cwd as the daemon working_dir.
  • Pass the target session ID through target_session_id while preserving history replay behavior.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is narrowly scoped to the ACP attach handshake and matches the daemon requirement that stateful clients subscribe before other session requests.

Files Needing Attention: No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the cargo test suite and opened the proof log titled trex-cargo-test log 20260804T224740Z to inspect results; the log shows compiler errors such as expected ConfidenceState, found integer at src/cli/commands/menubar.rs:869, and an Option<ConfidenceState> vs Option<u8> mismatch at src/cli/commands_tests.rs:262/263, plus GateObservation has no field named score at src/cli/commands_tests.rs:408/469, and the command completed with EXIT_STATUS: 101 on 2026-08-04T22:47:46Z.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/cli/acp.rs Updates ACP session attach to open the daemon connection with a target-aware Subscribe, forwarding the caller cwd while preserving history replay.

Sequence Diagram

sequenceDiagram
participant ACP as ACP runtime
participant Daemon as Jcode daemon
participant Session as Target session

ACP->>Daemon: "Subscribe(id=1, working_dir=cwd, target_session_id)"
Daemon->>Session: Attach or restore target session
Session-->>Daemon: History(session_id, messages)
Daemon-->>ACP: History
ACP->>ACP: Replay history when requested
Daemon-->>ACP: "Done(id=1)"
ACP->>ACP: Store DaemonSession with attached session_id
Loading

Reviews (1): Last reviewed commit: "fix: subscribe before ACP session attach..." | Re-trigger Greptile

@1jehuang

1jehuang commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

CI follow-up: Format, linked-issue, release automation, installer, TypeScript, PowerShell, Windows cross-target, and Greptile checks pass. The failing macOS and Quality Guardrails jobs reproduce the existing master compile mismatch tracked in #768 (commands_tests.rs still uses numeric confidence values and GateObservation.score); they do not involve the ACP file changed here. Windows and Ubuntu jobs are still pending.

--- — Jcode agent (automated triage), on behalf of @1jehuang

@1jehuang

1jehuang commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Final CI follow-up: Ubuntu has now completed and failed on the same seven pre-existing commands_tests.rs errors tracked in #768 (Option<u8> versus Option<ConfidenceState> and removed GateObservation.score). macOS and Quality Guardrails show the same baseline failure. Windows remains queued; all completed checks unrelated to that master break pass.

--- — Jcode agent (automated triage), on behalf of @1jehuang

@1jehuang
1jehuang merged commit c18d1fc into master Aug 4, 2026
8 of 12 checks passed
vpelikh pushed a commit to vpelikh/jcode that referenced this pull request Aug 30, 2026
…e-subscribe

fix: subscribe before ACP session attach
vpelikh added a commit to vpelikh/jcode that referenced this pull request Sep 3, 2026
…e-subscribe

fix: subscribe before ACP session attach
vpelikh added a commit to vpelikh/jcode that referenced this pull request Sep 3, 2026
…e-subscribe

fix: subscribe before ACP session attach
vpelikh pushed a commit to vpelikh/jcode that referenced this pull request Sep 3, 2026
…e-subscribe

fix: subscribe before ACP session attach
vpelikh pushed a commit to vpelikh/jcode that referenced this pull request Sep 3, 2026
…e-subscribe

fix: subscribe before ACP session attach
alecuba16 pushed a commit to alecuba16/jcode that referenced this pull request Sep 18, 2026
…e-subscribe

fix: subscribe before ACP session attach
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.

1 participant