feat: add --session-meta and --claude-agent CLI options#32
Open
taosu0216 wants to merge 1 commit intoopenclaw:mainfrom
Open
feat: add --session-meta and --claude-agent CLI options#32taosu0216 wants to merge 1 commit intoopenclaw:mainfrom
taosu0216 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Allow passing _meta to ACP newSession requests, enabling adapter-specific
configuration from the CLI.
--session-meta <json>: generic JSON passthrough set as _meta on newSession
--claude-agent <name>: sugar for claude-agent-acp, builds
{ claudeCode: { options: { agent: "<name>" } } }
Both options can be combined; --claude-agent deep-merges into --session-meta.
Supported on exec, sessions new, and sessions ensure commands.
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.
Summary
--session-meta <json>global option to pass arbitrary_metato ACPnewSessionrequests, enabling adapter-specific configuration from the CLI--claude-agent <name>global option as syntactic sugar forclaude-agent-acp, automatically building{ claudeCode: { options: { agent: "<name>" } } }--claude-agentdeep-merges into--session-metaMotivation
claude-agent-acpsupports theagentparameter via_meta.claudeCode.options(which maps to Claude Code's--agentflag for loading.claude/agents/<name>.md), but there was no way to set_metafrom the acpx CLI. This feature enables role-based agent dispatch (e.g.,research,implement,check) through acpx.Usage
Changes
src/types.tssessionMetatoAcpClientOptionssrc/client.tssessionMetaas_metainnewSession()src/session-runtime.tssessionMetathroughRunOnceOptions,SessionCreateOptions,SessionEnsureOptionssrc/cli.ts--session-metaand--claude-agentglobal options with JSON parsing, validation, and deep mergeScope
Supported on
exec,sessions new, andsessions ensurecommands. Thepromptcommand uses detached queue owners which would require additional plumbing — left as a potential follow-up.Test plan
acpx --claude-agent research exec "hello"creates session with correct_metaacpx --session-meta '{"foo":"bar"}' exec "hello"passes raw JSON as_meta--session-metawith invalid JSON throwsInvalidArgumentError--claude-agentand--session-metacan be combined (deep merge)acpx --claude-agent research sessions newcreates a session with agent configtypecheck,lint,format:check,build