Skip to content

feat(wrapper): opt-in repo-qualified tmux sessions and per-agent env overrides - #92

Open
maxlamagna wants to merge 1 commit into
bcurts:mainfrom
maxlamagna:feat/repo-qualified-wrapper-sessions
Open

feat(wrapper): opt-in repo-qualified tmux sessions and per-agent env overrides#92
maxlamagna wants to merge 1 commit into
bcurts:mainfrom
maxlamagna:feat/repo-qualified-wrapper-sessions

Conversation

@maxlamagna

Copy link
Copy Markdown
Contributor

Closes #67.

Implements the proposal in #67, which has been open since May.

Shared installs collide. Each project's server issues its own slot counter from 1, so the first wrapper for an agent in any project asks for the same agentchattr-<agent> tmux session, and wrapper_unix kills a pre-existing session of that name before creating its own. Two onboarded projects therefore evict each other.

Two opt-in mechanisms, both no-ops when unset:

  • AGENTCHATTR_AGENT_<KEY> overlays one agent's config, so a per-project launcher need not edit the shared config.toml. Whitelisted to cwd and mcp_settings_path so a committed project env file cannot redirect security-sensitive keys such as command or mcp_inject.
  • AGENTCHATTR_REPO_SLUG qualifies the tmux session name.

Both are extracted into named helpers so they can be tested directly. The config overlay keeps its original in-place update semantics, so this stays a testability refactor rather than a second behavioural change.

README documents both variables alongside the existing AGENTCHATTR_* list.

Tests: 17 behavioural tests; six critical guard mutations, 6/6 killed. No source-text assertions.

Correction to the issue text: #67 says "Tests included (11 tests) … available in our local checkout", including "structural presence". That was written before the tests existed. What is actually here is 17 behavioural tests and no structural assertions.


Ordering: #91 fixes an intermittent 502 in ProxyHeaderForwardingTests that is unrelated to this change but can make a full-suite run here fail at random. Merging that first makes this one read cleanly. This PR does not otherwise depend on it.

…overrides

Shared installs collide. Each project's server issues its own slot counter from
1, so the first wrapper for an agent in any project asks for the same
`agentchattr-<agent>` tmux session, and wrapper_unix kills a pre-existing
session of that name before creating its own. Two onboarded projects therefore
evict each other.

Two opt-in mechanisms, both no-ops when unset:

- `AGENTCHATTR_AGENT_<KEY>` overlays one agent's config, so a per-project
  launcher need not edit the shared config.toml. Whitelisted to `cwd` and
  `mcp_settings_path` so a committed project env file cannot redirect
  security-sensitive keys such as `command` or `mcp_inject`.
- `AGENTCHATTR_REPO_SLUG` qualifies the tmux session name.

Both are extracted into named helpers so they can be tested directly. The
config overlay keeps its original in-place update semantics, so this stays a
testability refactor rather than a second behavioural change.

17 behavioural tests; six critical guard mutations, 6/6 killed. README
documents both variables alongside the existing AGENTCHATTR_* list.

Refs bcurts#67
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.

Support concurrent per-project wrapper sessions for shared installs

1 participant