Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(execenv): trim default runtime brief command list (MUL-2322) (#2769)
Multica Eve58a76f6d968c
diff --git a/server/internal/daemon/execenv/execenv_test.go b/server/internal/daemon/execenv/execenv_test.goindex a66bf26165..bbca4cd436 100644--- a/server/internal/daemon/execenv/execenv_test.go+++ b/server/internal/daemon/execenv/execenv_test.go@@ -585,30 +585,68 @@ func TestInjectRuntimeConfigClaude(t *testing.T) {}}-// Regression test for #2347: the runtime config injected into agent harnesses-// must advertise both autopilot execution modes on create AND update, so an-// agent acting as a CLI user is not confined to create_issue.-func TestInjectRuntimeConfigAutopilotAdvertisesBothModes(t *testing.T) {+func TestInjectRuntimeConfigAvailableCommandsCoreOnly(t *testing.T) {t.Parallel()dir := t.TempDir()- if _, err := InjectRuntimeConfig(dir, "claude", TaskContextForEnv{IssueID: "issue-1"}); err != nil {+ if _, err := InjectRuntimeConfig(dir, "codex", TaskContextForEnv{IssueID: "issue-1"}); err != nil {t.Fatalf("InjectRuntimeConfig failed: %v", err)}- content, err := os.ReadFile(filepath.Join(dir, "CLAUDE.md"))+ content, err := os.ReadFile(filepath.Join(dir, "AGENTS.md"))if err != nil {- t.Fatalf("failed to read CLAUDE.md: %v", err)+ t.Fatalf("failed to read AGENTS.md: %v", err)}s := string(content)for _, want := range []string{- "multica autopilot create --title \"...\" --agent <name> --mode create_issue|run_only",- "multica autopilot update <id>",- "[--mode create_issue|run_only]",+ "## Available Commands",+ "core agent loop and common issue create/update tasks",+ "`multica <command> --help`",+ "multica issue get <id> --output json",+ "multica issue comment list <issue-id>",+ "multica issue create --title",+ "multica issue update <id>",+ "--description-file <path>",+ "--parent \"\"",+ "multica repo checkout <url>",+ "multica issue status <id> <status>",+ "multica issue comment add <issue-id>",+ "multica issue comment add --help",} {if !strings.Contains(s, want) {- t.Errorf("CLAUDE.md missing %q", want)+ t.Errorf("AGENTS.md missing core command/help text %q\n---\n%s", want, s)+ }+ }++ for _, banned := range []string{+ "multica issue list [--status",+ "multica issue label list",+ "multica issue subscriber list",+ "multica label list",+ "multica workspace members",+ "multica agent list",+ "multica squad list",+ "multica issue runs",+ "multica issue run-messages",+ "multica attachment download",+ "multica autopilot list",+ "multica autopilot create",+ "multica autopilot update",+ "multica autopilot trigger",+ "multica autopilot delete",+ "multica project get",+ "multica project resource list",+ "multica issue assign",+ "multica issue label add",+ "multica issue label remove",+ "multica issue subscriber add",+ "multica issue subscriber remove",+ "multica issue comment delete",+ "multica label create",+ } {+ if strings.Contains(s, banned) {+ t.Errorf("AGENTS.md should not inject non-core command %q\n---\n%s", banned, s)}}}@@ -1062,20 +1100,19 @@ func TestInjectRuntimeConfigRequiresExplicitCommentPost(t *testing.T) {}}-// TestInjectRuntimeConfigAvailableCommandsIsNeutral pins that the global-// Available Commands section lists the three input modes neutrally for-// every non-Codex provider on every host OS, with no "MUST pipe via stdin"-// mandate.+// TestInjectRuntimeConfigAvailableCommandsIsNeutral pins that the core+// Available Commands section lists comment input modes neutrally for every+// non-Codex provider on every host OS, with no "MUST pipe via stdin" mandate.//// Background: #1795 / #1851 introduced "MUST pipe via stdin" /// `--description-stdin` directives in the global section to fix Codex's// habit of emitting literal `\n` inside `--content "..."` (MUL-1467).-// That mandate landed in the all-provider section and ended up steering-// every provider at stdin — which then broke non-ASCII bytes on Windows-// shells (#2198 / #2236 / #2376). This rollback keeps the strong-// Codex-specific mandate in the Codex-Specific section (pinned by-// TestInjectRuntimeConfigCodexLinuxEmphasizesStdin) and leaves the global-// section neutral.+// That mandate landed in the all-provider section and ended up steering every+// provider at stdin — which then broke non-ASCII bytes on Windows shells+// (#2198 / #2236 / #2376). This rollback keeps the strong Codex-specific+// mandate in the Codex-Specific section (pinned by+// TestInjectRuntimeConfigCodexLinuxEmphasizesStdin) and leaves the core global+// command entry neutral.//// Not parallel: mutates the package-level runtimeGOOS.func TestInjectRuntimeConfigAvailableCommandsIsNeutral(t *testing.T) {@@ -1106,11 +1143,9 @@ func TestInjectRuntimeConfigAvailableCommandsIsNeutral(t *testing.T) {// Available Commands lists all three input modes as fact.for _, want := range []string{- "`--content \"...\"`",- "`--content-stdin`",- "`--content-file <path>`",- "`--description-stdin`",- "`--description-file <path>`",+ "--content \"...\"",+ "--content-stdin",+ "--content-file <path>",} {if !strings.Contains(s, want) {t.Errorf("%s missing flag mention %q\n---\n%s", configFile, want, s)diff --git a/server/internal/daemon/execenv/reply_instructions_test.go b/server/internal/daemon/execenv/reply_instructions_test.goindex 5a78e83c8c..c68e202c28 100644--- a/server/internal/daemon/execenv/reply_instructions_test.go+++ b/server/internal/daemon/execenv/reply_instructions_test.go@@ -223,7 +223,6 @@ func TestInjectRuntimeConfigWindowsCommentTriggerHasNoStdin(t *testing.T) {for _, want := range []string{"multica issue comment add " + issueID + " --parent " + triggerID + " --content-file","--content-file",- "--description-file","On Windows, write the reply body to a UTF-8 file",} {if !strings.Contains(s, want) {diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.goindex 6bc684ecdb..ce6d790b1c 100644--- a/server/internal/daemon/execenv/runtime_config.go+++ b/server/internal/daemon/execenv/runtime_config.go@@ -110,38 +110,16 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {b.WriteString("## Available Commands\n\n")b.WriteString("**Use `--output json` for structured data.** Human table output now prints routable issue keys (for example `MUL-123`) and short UUID prefixes for workspace resources; use `--full-id` on list commands when you need canonical UUIDs.\n\n")- b.WriteString("### Read\n")- b.WriteString("- `multica issue get <id> --output json` — Get full issue details (title, description, status, priority, assignee)\n")- b.WriteString("- `multica issue list [--status X] [--priority X] [--assignee X | --assignee-id <uuid>] [--limit N] [--offset N] [--full-id] [--output json]` — List issues in workspace (default limit: 50; table output uses routable issue keys; JSON output includes `total`, `has_more` — use offset to paginate when `has_more` is true). Prefer `--assignee-id <uuid>` when scripting from `multica workspace members --output json` / `multica agent list --output json` / `multica squad list --output json`.\n")- b.WriteString("- `multica issue comment list <issue-id> [--since <RFC3339>] --output json` — List all comments on an issue (server caps at 2000 rows). Use `--since` for incremental polling.\n")- b.WriteString("- `multica issue label list <issue-id> --output json` — List labels currently attached to an issue\n")- b.WriteString("- `multica issue subscriber list <issue-id> --output json` — List members/agents subscribed to an issue\n")- b.WriteString("- `multica label list --output json` — List all labels defined in the workspace (returns id + name + color)\n")- b.WriteString("- `multica workspace get --output json` — Get workspace details and context\n")- b.WriteString("- `multica workspace members [workspace-id] --output json` — List workspace members (user IDs, names, roles)\n")- b.WriteString("- `multica agent list --output json` — List agents in workspace\n")- b.WriteString("- `multica squad list --output json` — List squads in workspace (squads are first-class assignees — assigning an issue to a squad routes it to the squad leader, who then delegates)\n")+ b.WriteString("The default brief includes the commands needed for the core agent loop and common issue create/update tasks. For everything else, run `multica --help`, `multica <command> --help`, or `multica <command> <subcommand> --help`; prefer `--output json` when the command supports it.\n\n")+ b.WriteString("### Core\n")+ b.WriteString("- `multica issue get <id> --output json` — Get full issue details.\n")+ b.WriteString("- `multica issue comment list <issue-id> [--since <RFC3339>] --output json` — List comments on an issue; use `--since` for incremental polling.\n")+ b.WriteString("- `multica issue create --title \"...\" [--description \"...\" | --description-stdin | --description-file <path>] [--priority X] [--status X] [--assignee X | --assignee-id <uuid>] [--parent <issue-id>] [--project <project-id>] [--due-date <RFC3339>] [--attachment <path>]` — Create a new issue; `--attachment` may be repeated.\n")+ b.WriteString("- `multica issue update <id> [--title X] [--description X | --description-stdin | --description-file <path>] [--priority X] [--status X] [--assignee X | --assignee-id <uuid>] [--parent <issue-id>] [--project <project-id>] [--due-date <RFC3339>]` — Update issue fields; use `--parent \"\"` to clear parent.\n")b.WriteString("- `multica repo checkout <url> [--ref <branch-or-sha>]` — Check out a repository into the working directory (creates a git worktree with a dedicated branch; use `--ref` for review/QA on a specific branch, tag, or commit)\n")- b.WriteString("- `multica issue runs <issue-id> [--full-id] --output json` — List all execution runs for an issue (status, timestamps, errors); table task IDs are short prefixes unless `--full-id` is set\n")- b.WriteString("- `multica issue run-messages <task-id> [--issue <issue-id>] [--since <seq>] --output json` — List messages for a specific execution run; full task UUIDs work directly, copied short task prefixes must be scoped with `--issue <issue-id>`\n")- b.WriteString("- `multica attachment download <id> [-o <dir>]` — Download an attachment file locally by ID\n")- b.WriteString("- `multica autopilot list [--status X] [--full-id] [--output json]` — List autopilots (scheduled/triggered agent automations) in the workspace; copied short IDs are accepted by autopilot subcommands when unique\n")- b.WriteString("- `multica autopilot get <id> --output json` — Get autopilot details including triggers\n")- b.WriteString("- `multica autopilot runs <id> [--limit N] --output json` — List execution history for an autopilot\n")- b.WriteString("- `multica project get <id> --output json` — Get project details. Includes `resource_count`; the resources themselves live at the sub-collection below.\n")- b.WriteString("- `multica project resource list <project-id> --output json` — List resources (e.g. github_repo) attached to a project. Use this when `resource_count > 0` and you need the actual refs.\n\n")-- b.WriteString("### Write\n")- b.WriteString("- `multica issue create --title \"...\" [--description \"...\"] [--priority X] [--status X] [--assignee X | --assignee-id <uuid>] [--parent <issue-id>] [--project <project-id>] [--due-date <RFC3339>] [--attachment <path>]` — Create a new issue. `--attachment` may be repeated to upload multiple files; labels and subscribers are not accepted here, attach them after create with the commands below.\n")- b.WriteString("- `multica issue update <id> [--title X] [--description X] [--priority X] [--status X] [--assignee X | --assignee-id <uuid>] [--parent <issue-id>] [--project <project-id>] [--due-date <RFC3339>]` — Update one or more issue fields in a single call. Use `--parent \"\"` to clear the parent.\n")b.WriteString("- `multica issue status <id> <status>` — Shortcut for `issue update --status` when you only need to flip status (todo, in_progress, in_review, done, blocked, backlog, cancelled)\n")- b.WriteString("- `multica issue assign <id> --to <name>|--to-id <uuid>` — Assign an issue to a member, agent, or squad. `--to <name>` does fuzzy name matching; pass `--to-id <uuid>` (mutually exclusive with `--to`) to assign by canonical UUID, e.g. when names overlap. Use `--unassign` to clear the assignee.\n")- b.WriteString("- `multica issue label add <issue-id> <label-id>` — Attach a label to an issue (look up the label id via `multica label list`)\n")- b.WriteString("- `multica issue label remove <issue-id> <label-id>` — Detach a label from an issue\n")- b.WriteString("- `multica issue subscriber add <issue-id> [--user <name>|--user-id <uuid>]` — Subscribe a member or agent to issue updates (defaults to the caller when neither flag is set; the two flags are mutually exclusive)\n")- b.WriteString("- `multica issue subscriber remove <issue-id> [--user <name>|--user-id <uuid>]` — Unsubscribe a member or agent\n")- // Available Commands lists `multica issue comment add` and the- // description flags neutrally — three input modes, pick what fits.+ // Available Commands lists `multica issue comment add` neutrally —+ // three input modes, pick what fits.// The previous "MUST pipe via stdin" mandate (#1795 / #1851) was// originally a Codex-specific fix for codex emitting literal `\n`// escapes inside `--content "..."`, but it landed in this global@@ -156,18 +134,7 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {// escaping correctly and can pick whichever flag suits their// content. The `--content-file` line in the menu doubles as a// pointer at the Windows-safe path.- b.WriteString("- `multica issue comment add <issue-id> [--content \"...\" | --content-stdin | --content-file <path>] [--parent <comment-id>] [--attachment <path>]` — Post a comment. Three input modes, pick whichever fits the content:\n")- b.WriteString(" - `--content \"...\"` for short single-line text. The CLI decodes `\\n`, `\\r`, `\\t`, `\\\\` so escaped multi-line is OK; do not embed raw newlines in the argument.\n")- b.WriteString(" - `--content-stdin` to pipe the body via HEREDOC. Preserves multi-line and special characters verbatim. Cleanest in `bash` / `zsh`.\n")- b.WriteString(" - `--content-file <path>` to read a UTF-8 file off disk. Preserves bytes verbatim regardless of the shell — use this on Windows when stdin would re-encode non-ASCII (Chinese, Japanese, Cyrillic, accents, emoji) through the console codepage and drop them as `?`.\n")- b.WriteString(" - Use `--parent` to reply to a specific comment; `--attachment` may be repeated.\n")- b.WriteString("- `multica issue create` / `multica issue update` accept the same three modes for `--description`: `--description \"...\"`, `--description-stdin`, or `--description-file <path>`.\n")- b.WriteString("- `multica issue comment delete <comment-id>` — Delete a comment\n")- b.WriteString("- `multica label create --name \"...\" --color \"#hex\"` — Define a new workspace label (use this only when the label you need does not exist yet; reuse existing labels via `multica label list` first)\n")- b.WriteString("- `multica autopilot create --title \"...\" --agent <name> --mode create_issue|run_only [--description \"...\"]` — Create an autopilot\n")- b.WriteString("- `multica autopilot update <id> [--title X] [--description X] [--status active|paused] [--mode create_issue|run_only]` — Update an autopilot\n")- b.WriteString("- `multica autopilot trigger <id>` — Manually trigger an autopilot to run once\n")- b.WriteString("- `multica autopilot delete <id>` — Delete an autopilot\n\n")+ b.WriteString("- `multica issue comment add <issue-id> [--content \"...\" | --content-stdin | --content-file <path>] [--parent <comment-id>] [--attachment <path>]` — Post a comment. Pick the input mode that preserves your content; run `multica issue comment add --help` for details.\n\n")if provider == "codex" {b.WriteString("## Codex-Specific Comment Formatting\n\n")@@ -340,14 +307,11 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {b.WriteString("- Delegating a concrete sub-task to another agent for the first time, with a clear request.\n")b.WriteString("- The user explicitly asked you to loop someone in.\n\n")b.WriteString("If you are unsure whether a mention is warranted, **don't mention**. Silence ends conversations; `@` restarts them.\n\n")- b.WriteString("Use `multica issue list --output json` to look up issue IDs, and `multica workspace members --output json` for member IDs.\n\n")+ b.WriteString("If you need IDs for mention links, inspect the relevant CLI help path and request JSON output when available.\n\n")b.WriteString("## Attachments\n\n")b.WriteString("Issues and comments may include file attachments (images, documents, etc.).\n")- b.WriteString("Use the download command to fetch attachment files locally:\n\n")- b.WriteString("```\nmultica attachment download <attachment-id>\n```\n\n")- b.WriteString("This downloads the file to the current directory and prints the local path. Use `-o <dir>` to save elsewhere.\n")- b.WriteString("After downloading, you can read the file directly (e.g. view an image, read a document).\n\n")+ b.WriteString("When a task includes attachment IDs and you need the files, inspect `multica attachment --help` and use the authenticated CLI path. Do not open Multica resource URLs directly.\n\n")b.WriteString("## Important: Always Use the `multica` CLI\n\n")b.WriteString("All interactions with Multica platform resources — including issues, comments, attachments, images, files, and any other platform data — **must** go through the `multica` CLI. ")