Skip to content

fix(remote): isolate restored agent configuration - #353

Merged
wzz6423 merged 1 commit into
mainfrom
fix/agent-resume-environment
Dec 5, 2026
Merged

wzz6423 merged 1 commit into
mainfrom
fix/agent-resume-environment

Conversation

@wzz6423

@wzz6423 wzz6423 commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

When a remote daemon restarts with different provider configuration variables, resuming or forking a saved conversation can combine its recorded profile with the daemon's new configuration paths. Clear that provider's configuration variables before applying the saved environment. New terminals keep their existing inheritance behavior, and the removal list remains internal to the daemon.

Add real PTY regressions for all four providers, sparse and complete OpenCode configuration, legacy and empty history, unrelated provider variables, and external attempts to select removals. Run them through the existing Agent CI entry point.

@coderabbitai summary

GitHub Project

  • Project: zshell Development
  • Start date: 2026-12-05
  • Target date: 2026-12-05

PR Type

  • Type: fix

Validation

  • Status: passed

  • Command: cargo test --locked --manifest-path remote/Cargo.toml

  • Result: 47 tests passed on macOS using the installed Rustup stable toolchain and an isolated Cargo target directory, including serialization isolation for the internal removal list.

  • Status: passed

  • Command: cargo build --locked --manifest-path remote/Cargo.toml and python3 -B remote/tests/test_agents.py --binary <isolated-built-zshell-server>

  • Result: 150 production checks passed: 52 Agent lifecycle and exact-resume checks, 39 native-fork checks, and 59 configuration-environment checks. Tests use disposable providers, real PTYs, production history, and daemon restarts.

  • Status: passed

  • Command: python3 -B remote/tests/test_agent_environment.py --operation agentResume --binary <c152d0a-built-zshell-server> and the same command with --operation agentFork

  • Result: Both negative controls reproduced the original OpenCode configuration-inheritance assertion against c152d0a. The same scenarios pass with this change.

  • Status: passed

  • Command: make format and git diff --check

  • Result: Formatting produced no additional changes; the diff has no whitespace errors.

  • Status: passed

  • Command: make run DERIVED_DATA=<temporary-build>; codesign --verify --deep --strict --verbose=2 <built-debug-app>; python3 -B remote/tests/test_agent_environment.py --binary <built-debug-app>/Contents/Resources/zshell-server

  • Result: Full macOS Debug build, app launch and signature verification passed. The actual bundled remote server also passed all 59 real-PTY environment checks. A separate coordinating-agent run against the isolated server build passed the same 59 checks. Providers are disposable fixtures.

  • Status: not run

  • Reason: CI completion is not awaited for this maintainer-authorized change.

Risk and Rollback

  • Risk: Resumed and forked conversations no longer inherit provider configuration variables absent from their saved history. Legacy history restores its recorded directory when present. New terminals and unrelated providers keep their current environment.
  • Rollback: Revert this pull request.

Related Issue

None

AI Attribution

Co-authored-by: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@wzz6423
wzz6423 marked this pull request as ready for review December 5, 2026 03:38
@wzz6423
wzz6423 merged commit f7369ca into main Dec 5, 2026
30 checks passed
@wzz6423
wzz6423 deleted the fix/agent-resume-environment branch December 5, 2026 03:39
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