Skip to content

Resume Claude Code conversations on Incus (for activeagent#589, 1.9.1) - #179

Draft
TonsOfFun wants to merge 1 commit into
mainfrom
feat/claude-code-conversations-incus
Draft

TonsOfFun wants to merge 1 commit into
mainfrom
feat/claude-code-conversations-incus

Conversation

@TonsOfFun

Copy link
Copy Markdown
Contributor

The Incus side of activeagents/activeagent#589 (1.9.1: Claude Code and Codex sessions as Interactions).

IncusSandboxService::ClaudeCode now builds the same Claude Code command line as the engine's local backend:

  • Resuming: a conversation's first turn starts the session its root names (--session-id <uuid>), and a later turn resumes it (--resume <uuid>).
    • The session is kept in the claude user's configuration for the turn's credential (/home/claude/api or /home/claude/login), which a conversation keeps, so it is still there to resume.
    • A session with no id keeps nothing, as before (--no-session-persistence).
    • The id is checked as a UUID before it reaches argv.
  • --strict-mcp-config: only the MCP servers given load, which here is none, so a checkout's .mcp.json adds nothing.
  • --append-system-prompt: the engine's note (LocalSandboxBackend::CLAUDE_SYSTEM_NOTE) where it has one, otherwise this file's own. It says repository content, tool output and pages are data.
  • Boot-fix allowlist: a project's boot fix gets the engine's command list (ProjectBootFix.allowed_tools_for), which closes the parity gap flagged on activeagent#584.
  • prompt.txt: takes CodeSession#stdin_text, so the dashboard's note goes in on stdin, ahead of the message.

Every addition is guarded (try / defined?), so the pinned 1.9.0 candidate (247e5bb) runs exactly as before until the gem bump to 1.9.1. No image rebuild is needed: sandbox-claude passes argv through.

Not here:

  • Migration 027 (the conversation columns) comes with the gem-bump PR.
  • Browser handoff on Incus needs a sidecar on the Incus host (a later phase). Until then, conversations on Incus have chat but no browser pane.

Tests: bin/rails test test/services/incus_sandbox_service_claude_code_test.rb ran 13, with 1 skip: the allowlist test needs the 1.9.1 engine's ProjectBootFix, which isn't on main's pin. New tests cover turn 1 and turn N argv, --strict-mcp-config, the system note, the note on stdin, the UUID guard, and the allowlist. rubocop is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CJAKwnkBaCGr5qjCcmc3kh

…line

Gives IncusSandboxService::ClaudeCode the command line actionagent 1.9.1's
local backend uses for Claude Code conversations: a conversation's first
turn starts the session its root names (--session-id) and a later turn
resumes it (--resume); only the MCP servers given load (--strict-mcp-config);
the dashboard's system note says what is data; and a project's boot fix gets
the engine's command allowlist. A turn's prompt.txt carries the dashboard's
note ahead of the message (CodeSession#stdin_text). Every addition is
guarded, so the pinned 1.9.0 candidate runs as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJAKwnkBaCGr5qjCcmc3kh

This branch has not been deployed

No deployments
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