Skip to content

refactor(engine): share built-in threads through the agent trait - #4244

Closed
LHagfoss wants to merge 3 commits into
mainfrom
refactor/builtin-agent-remote-share
Closed

LHagfoss wants to merge 3 commits into
mainfrom
refactor/builtin-agent-remote-share

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Step 4 of ADR 0008, after #4243 (stacked on it).

  • The remote share publishes a built-in thread through a BuiltinPublisher trait object the agent returns from BuiltinAgent::share. Previously the engine held a SessionPublisher and locked AppState itself.
  • Device reads, mutations and the get_changes workspace go through remote_read, remote_mutation and remote_changes_workspace. The status model goes through selected_model.
  • The agent-side code lives in acp/share.rs.
  • RemoteSession.state and AcpSession.state are gone: the ACP server holds a built-in thread only as the trait object. The agent tests in acp_tests.rs read state through a #[cfg(test)] accessor until they move with the crate.

Changelog

No user-facing change.

Testing

cargo check --workspace --tests and cargo clippy -p rustcode --tests (no new warnings); CI runs the remote and ACP tests.

Remote turns take queued prompts, run them and promote leftover steers
through BuiltinAgent instead of locking AppState and calling run_prompt.
The remote share's publisher, device reads, mutations and changes
workspace go through BuiltinAgent and a BuiltinPublisher trait object.
RemoteSession and AcpSession no longer hold the thread's AppState.
@github-actions github-actions Bot added the refactor Code improvement and restructuring label Nov 22, 2026
@LHagfoss

Copy link
Copy Markdown
Owner Author

Included in #4245, which carried this branch's commits; its files match main.

@LHagfoss LHagfoss closed this Nov 22, 2026
@LHagfoss
LHagfoss deleted the refactor/builtin-agent-remote-share branch November 22, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code improvement and restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant