Skip to content

fix(agent): restore native CLI workspace and conversation behavior - #6816

Merged
M4n5ter merged 1 commit into
rust-previewfrom
codex/restore-native-agent-sessions
Nov 12, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
codex/restore-native-agent-sessions

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 12, 2026

Copy link
Copy Markdown
Member

Summary

After #6713, a read-only conversation could select a native CLI, hide the sandbox selector, and then block the run before launch. Native CLI turns also ran from workspace copies and started fresh native sessions.

Restore the behavior covered by the enablement prompt. Built-in Claude Code, Codex, and Antigravity use the original workspace and account profile with native full access. The composer continues to hide the sandbox selector for these CLIs. Calls back into Maka over MCP still use the session's permissions.

Claude Code runs in an interactive PTY again. All three CLIs resume the same native conversation across Host restarts and receive Maka instructions as a separate user message when the instructions change. Existing Maka history supplies context on the first turn when there is no native session checkpoint.

Refs #6702, #6721, #6713.

Verification

  • cargo test --release --locked -p maka-cli --test external_jobs passed both tests on macOS. They cover direct writes from a read-only session, native continuation after Host restart, per-turn usage on resume, exact Stop, and recovery without resubmitting the original input.
  • Antigravity 1.5.6 used the existing sign-in. Its native run_command wrote directly into the original workspace from a read-only Maka session, recorded a tool title, and continued with the same native conversation ID after restarting Host.
  • Real Claude Code 2.1.322 with a loopback Anthropic model fixture used one PTY transcript across two turns and a Host restart. The provider request carried Maka instructions in a user message. Subscription metering was outside this test.
  • Real Codex CLI resumed the same thread across two turns and a Host restart. The captured protocol showed thread/inject_items only on the first turn and thread/resume on the second.

AI use

  • Generative tooling made a substantive contribution

OpenAI Codex implemented and verified the change.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes, described under Summary above

@M4n5ter
M4n5ter merged commit 7382ed2 into rust-preview Nov 12, 2026
1 check passed
@M4n5ter
M4n5ter deleted the codex/restore-native-agent-sessions branch November 12, 2026 02:23

@Astro-Han Astro-Han left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update on 12 November: the two diagnosed source defects have been corrected in later rust-preview commits. I read both one-line diffs and verified that the fixes are present at 8faeefd79bd24fd12d0a45a4cefeef80d58ade28.

  • #6821, landed as 08bcd01a03e48cd56764790002c26efd11094402, removes cfg(unix) from the invalid helper. I read the original Windows job log at that exact landing: the production maka-cli build completes; its later workspace test compilation fails on the separately diagnosed missing live_workspace field. The E0425 source defect is corrected.
  • #6825, landed as 8faeefd79bd24fd12d0a45a4cefeef80d58ade28, supplies live_workspace: false in the affected staged-task fixture. This corrects the missing initializer. I also read the successful Linux workspace build log at merge preview ad54aeb5b5861e741c55ed6122be11a2895825dd: cargo nextest list --locked --workspace -E all() compiles the test targets, and the subsequent archives include maka-agent-engine. Both corrected files have identical Git blobs in this compiled preview and in 8faeefd79bd24fd12d0a45a4cefeef80d58ade28. This is compilation evidence, not successful execution of the archived tests. The author's nine passing reconcile tests are the author's results; I have not rerun them. The CI run for this landing has not completed at this update, so I am not claiming a successful current workspace test build or complete platform acceptance.

Further compilation evidence: the original Windows log for #6825 builds the workspace test targets at preview b2ec67b7fd4a135f00bd87519c0d75abd3b45457, then reaches native and Desktop test execution. I verified that this preview's entire Git tree equals landing 8faeefd79bd24fd12d0a45a4cefeef80d58ade28. The Linux workspace build at that landing also completes. This confirms the compilation fixes on Windows and Linux, beyond source inspection. The Windows Desktop suite is 19 passed / 4 failed, and the landing's macOS Desktop log is 21 passed / 3 failed; I have not isolated the causes of those UI failures. These results do not establish complete runtime acceptance. The newer 7d572089bab6b54ee8cf051a5358775a9d7930f5 branch build is a separate run and is not reported as successful here.

The diagnostics below describe the original PR head and its earlier landings. They should not be read as two unchanged source defects in the current branch. Real CLI, PTY, permissions and recovery acceptance remains outside this limited follow-up.

Original-head evidence

I checked the two new compilation failures introduced at final head 0fb6c5758138aa23bef2026e9a2885f0abb62900: the changed ExternalTask type, its existing engine-test constructor, and the changed evidence reader plus its conditional helper. I also read the original CI logs and verified their actual checkout commits. This is a limited compilation follow-up, not complete acceptance of the 31-file native CLI, PTY, permissions and recovery changes.

Two P2 build regressions were demonstrated at the original head:

  • The new required ExternalTask.live_workspace field is missing from the constructor in plugins/agent/engine/src/reconcile/tests.rs:681. The PR's Linux root-build, checked out at merge preview d16cb759a678fef92adcb237274983aeb9f61c9a, fails cargo test --no-run --workspace --locked with E0063. The landing root-build at 7382ed22af275c4a1b934deeb0711bd6bd58db3f has the same error. Serde's default does not fill fields in a Rust struct literal. Update the remaining constructor and verify the full workspace test build.
  • ClosedEvidence::baseline_reader now calls invalid, but that helper is compiled only under cfg(unix). The PR's Windows build, at the same d16cb759a678fef92adcb237274983aeb9f61c9a preview, fails with E0425 at platform/process/src/isolated/evidence.rs:444. The landing Windows build confirms the failure at 7382ed22af275c4a1b934deeb0711bd6bd58db3f. Make the error constructor available on Windows as well.

The preceding ba3fbe8e9aae335fe57607309f8a0df526bf831d root-build compiles the workspace tests, and its Windows job gets past compilation into native tests. These new errors occur before those tests. The later 1b5638815367802e2286dc232b4f0042a67819f6 logs still contain E0063 and E0425.

I did not run a local Windows build or independently validate real CLI accounts, PTY behavior, persistence compatibility, Host restart, or Stop/recovery. The author's runtime results remain attributed to the author.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

pub task: ExternalTaskId,
pub descriptor: ContentRef,
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub live_workspace: bool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: update every Rust constructor when adding this required field. The existing ExternalTask { ... } in plugins/agent/engine/src/reconcile/tests.rs:681 does not set live_workspace. Serde’s default only affects deserialization, so cargo test --no-run --workspace --locked now fails with E0063. This is present in both the PR merge-preview root-build and the landing build; the preceding ba3 workspace test build succeeds. Please update the remaining initializer and rerun the workspace test compilation.

&self.resource,
self.snapshot
.clone()
.ok_or_else(|| invalid("live task has no baseline"))?,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: this new call does not compile on Windows. baseline_reader is compiled for every platform, while this module’s invalid helper at line 629 is behind #[cfg(unix)]. The PR Windows job, at merge preview d16cb75, fails with E0425 here; the landing Windows job fails identically. Please make the error constructor available on Windows and check that target.

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.

2 participants