Skip to content

Profile command = base Coding Agent command + cell params (concatenation) ; rtk content-hash covers effective command+env #597

Description

@mblua

Summary

Change the coding-agent profile command model from REPLACEMENT to CONCATENATION, and update the #592 content-hash to cover the full effective command + env.

Today a profile cell's command REPLACES the agent's base command (the base is only a fallback when the cell is empty). The owner wants the effective launch command to be the CONCATENATION of:

  1. the Coding Agent's base command (the binary, e.g. claude-amp), plus
  2. the profile cell's command (just the params/flags).

So effective command = agent.command + " " + cell.command. The Coding Agent holds the binary once; each profile holds only its params.

Decisions (owner-confirmed)

  1. Concatenation, not replacement: effective command = base agent command + profile cell command.
  2. Hash reflects the full effective spawn: content-hash input = base command + cell command + base env + cell env (this SUPERSEDES Add profile content-hash (16-hex) to detect drifted running agents and enable manual reload #592's cell-only hash decision).
  3. No auto-migration: existing profiles today hold the full command in the cell and will break under concatenation; the owner will re-configure them manually (binary in the Coding Agent, params in the cell). Document the breaking change; do not attempt heuristic migration.
  4. UI label: in the profile cell editor, show a label like Command: <agent base command> followed by "what you type below", so the user sees the effective command is base + their input.

Scope / sites (verify against branch feature/592-profile-content-hash, base latest origin/main)

  • Command composition (config/agent_command.rs, build_agent_spawn_command ~711-715): change from cell.command if non-empty else agent.command to concatenation agent.command + cell.command. Edge cases to resolve: base empty, cell empty (no stray spaces), how the concatenated string tokenizes into shell + args, and interaction with %AC_*% placeholder expansion and the (being-removed in Remove git_pull_before and exclude_global_claude_md coding-agent options and all supporting code #590) git-pull wrap.
  • Content-hash (profile_content_hash in agent_command.rs): change input from cell-only to the effective command (base + cell) + effective env (base envs + cell env, as merged for launch). Replace/upd the cell-only test (profile_content_hash_is_cell_only_ignoring_agent_base_command) to assert the new effective model (editing the agent base command/env now DOES change the hash).
  • UI label (SettingsModal.tsx, profile cell editor): render a Command: <base> prefix label next to the cell command textbox so the effective command is visible.
  • Tests: concatenation composition (base+cell, empty-base, empty-cell), hash includes base command + base env, label renders.

Relationship to #592

#592 (content-hash drift detection + manual reload + replica persistence + Root Agent baseline fix) stays. This issue CHANGES what the hash covers (cell-only -> effective) and the command composition model (replace -> concatenate). Both ship together on feature/592-profile-content-hash; the PR closes both.

Acceptance criteria

  • Effective launch command = base agent command + profile cell command (concatenation), clean handling of empty base/cell (no stray whitespace, correct tokenization).
  • Content-hash covers base command + cell command + base env + cell env.
  • Profile cell editor shows the Command: <base> + your-input label.
  • Editing the base agent command, the cell command, or any env flips profileOutdated for a running agent.
  • Tests updated (cell-only test replaced by effective-model tests); full backend (cargo test --lib --bins --tests) + frontend (vitest) suites green.
  • Breaking change documented: existing profiles must be re-configured by the user (binary in the Coding Agent, params in the cell); no auto-migration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions