Repository navigation
feat(listen): presets default to own — runs act as the agent itself - #13
Merged
Merged
Conversation
`listen --preset claude-code|codex` takes --profile own|answer|work|full, `own` by default (the engine's): the coding agent's own permission settings, with anything that would ask refused. status and doctor say what the profile does; an installed listener keeps the profile its listener.json recorded. Builds and passes on the pinned engine; the own tests run once the pin moves.
…for idle status; texts A tagged release's tests fail unless the bundled engine has the own profile (the publish workflow's gate job runs them for the tag), so these texts cannot ship on the old engine; pull requests stay green on the pin. The runner factory names its runtime, so status says it while idle. The known limits (Windows, plan mode, a key a 0.5.2 placement left in .env) are said.
Releases before own wrote listener.json version 1 and recorded answer at every preset install, --profile or not, so it cannot be told apart from a choice. listener.json is now version 2. Reading a version-1 file maps its answer to the default (own); work and full are kept; version 2 is taken as written. The mapping is in the schema, so the service, listen, status and doctor agree, and the file is not rewritten. Installing with --profile answer (or AGENTCHAT_RUN_PROFILE=answer) writes version 2 with answer. status says when the service still runs an earlier release's listener copy (which reads listener.json as that release did) and that doctor --fix re-installs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
agentchat listen --preset claude-code|codexruns act as the agent itself by default. The profileowncomes from the engine (agentchatme/agentchat-agent-core#22): reply runs use your own Claude Code (or Codex) permission settings, with anything that would ask refused. Runs started by peers' messages act with those permissions.own:--mcp-configis passed without--strict-mcp-config. Itsagentchatis used, and the user's other servers load.--permission-prompts none --allowedTools mcp__agentchat__*, the key-store deny rules, and the served identity line.own:<home>/presets/codex.mcp-headers.mjs, owner-only, no key in it), so the run's environment carries none.$CODEX_HOME/.envsetsAGENTCHAT_API_KEY, or while theagentchatentry Codex reports namesbearer_token_env_var. A Codex integration from 0.5.2 or earlier left both, and Codex would send that agent's key in place of the helper's.doctornames the fix.--profiletakesown|answer|work|full. The usage and the refusal for an unknown--profilesay what each one does.status,listenanddoctor'slistenerline say what the profile does:runs the claude-code preset (profile own — reply runs use your own Claude Code permission settings, …). Theanswerline now says what it does too.doctor'spreset-mcplines describe what anownrun is given, andworkdirsays when own runs use the fallback folder.own, and the changelog leads with the upgrade note.urlandhttp_headers_helperoverrides take over an existing[mcp_servers.agentchat]table, verified this time.own. Earlier releases wroteanswerintolistener.json(version 1) at every install,--profileor not, so this release reads a version-1answerasown. A version-1workorfullis kept. The file is not rewritten.doctor --fixorlisten --installre-installs it.statussays when it still runs an earlier one.--profile answer(orAGENTCHAT_RUN_PROFILE=answer). A value that names no profile isanswer.ownrun's shell can read the home'scredentials.ownrun can read it with a program the user's rules let it start.Needs the new engine release before this is released. This PR builds and passes against the pinned
@agentchatme/agent-core0.5.2. On 0.5.2 the listener still resolves the old profiles (defaultanswer), and the tests that needownare skipped (ENGINE_HAS_OWN). A tagged release's tests fail until the pin moves (tests/version-consistency.test.ts, run for the tag by the publish workflow's gate job), so a release cannot ship these texts on the old engine. They run, and pass, once the pin moves. Merge the engine PR first. Move the pin at the release step. No version number is set here.Verification
pnpm type-check,pnpm build,pnpm testand the release smoke on Node 22 (macOS), both ways.presetPointerfor own: the address for Claude Code, the file for Codex.--presetdefaulting toown,--profile ownaccepted, an unknown environment value givinganswer.listener.jsonversions: v1answerreads asown(file untouched), v1work/fullkept, v2 taken as written (answerincluded), a newer version refused, every write v2, a new install without--profilewrites v2own,--profile answerandAGENTCHAT_RUN_PROFILE=answerwrite v2answer,statusandlisten --installsayownfor a v1 file, andstatusnames a service still on an earlier release's copy.own: the listener's file not strict, the identity line, no context switches, the deny list without the projects folder, the manual's address in the prompt. Codexown: one listing with the run's own flags (nothing switched off), the exact argv with the helper, the helper file in the home, no key in the run's environment.tests/version-consistency.test.ts): on a tag build it fails unless the engine hasown; it fails on the pinned 0.5.2 withGITHUB_REF_TYPE=tag.answertests now pass--profile answerexplicitly.ownrun did not overridebearer_token_env_var. Over a config a 0.5.2 Codex integration left (that variable, the key in$CODEX_HOME/.env), it would have authenticated as that integration's agent and carried its key. Such runs now refuse, verified live (engine PR).own.sh -c.owntest asserts on the environment of the spawned run.cmd /Cquoting of the helper. Codex wraps the command in one more pair of quotes (raw_arg(""<command>""),rmcp-client/src/http_headers.rs:446).describeMcpandworkwording.doctorshows PASS forowneven when the user's own settings amount tofull.HOME.own: the AgentChat tool reached the listener's server with the listener's key. The user-scopeagentchatof another agent got no request, and the user's other server connected.own: the helper in<home>/presets/authenticated as the listener's agent, over a helper-based[mcp_servers.agentchat]of another agent in the user's config. The run's environment held noAGENTCHAT*variable.own, home laid out as a 0.5.2 integration leaves it: the run did not start, for the.envkey and then for the entry'sbearer_token_env_var, with the fix named and no model call made.listen --preset claude-code --installwith no--profile;statusshowsprofile own — …; a peer's DM gets a reply.Risk and rollback
own, installed ones included once their service runs this release. One installed with--profile answerby this release keeps the lock.--profile answer.