Summary
Profiles automatically provisioned from agentlet harness discovery do not enable the harness catalogue's supported allow-all / auto-approval mode by default.
For example, agentlet correctly reports the GitHub Copilot recipe as:
binary: copilot
acpArgs: [--acp]
autoApprove: { args: [--allow-all], position: after-acp }
but Huabu persists the automatic Profile command as:
instead of:
copilot --acp --allow-all
The resulting automatically discovered Profile can unexpectedly stop for tool approvals and does not provide the intended ready-to-use autonomous Agent behavior.
Confirmed cause
harness-profile-discovery.ts constructs an automatic Profile with:
command: [harness.binary, ...harness.acpArgs].join(' ')
It ignores harness.autoApprove, even though that field is part of the versioned discovery contract and the trusted daemon-local catalogue. The existing discovery test explicitly expects copilot --acp, preserving the incorrect behavior.
The manual Profile form already has the canonical ordering logic:
before-acp: binary + autoApprove.args + acpArgs
after-acp: binary + acpArgs + autoApprove.args
Expected behavior
- Automatically provisioned Profiles default to the catalogue's official auto-approval recipe when
autoApprove is non-null.
- Copilot defaults to
copilot --acp --allow-all.
- Gemini and Qwen use their catalogue-defined approval modes.
- Kimi and Cursor preserve the required
before-acp ordering.
- Harnesses whose catalogue entry has
autoApprove: null remain unchanged; Huabu must not invent undocumented permission flags.
- Manually created Profiles retain their current explicit checkbox behavior and are not silently changed.
- Settings accurately display the effective launch mode for automatic Profiles.
Existing automatic Profiles
Define a safe migration/reconciliation policy for Profiles already created without the catalogue recipe:
- Preserve Profile ID, alias, workspace, placement, metadata, and unrelated customization.
- Upgrade only Profiles carrying valid
customData.discoveredAgent provenance whose launch command still matches the exact previously generated default.
- Do not rewrite a command that was customized or whose provenance/recipe is ambiguous.
- Make the migration idempotent and version-aware so reconnects do not repeatedly mutate Profiles.
- Do not delete/recreate a Profile merely to change its generated command, because existing Agent bindings and workload snapshots reference stable Profile IDs.
If the current Profile registry intentionally makes launch identity immutable, add an explicit registry-owned migration mechanism rather than bypassing that boundary.
Acceptance criteria
Relevant code
external/agentlet/packages/local/src/harnesses/catalogue.ts
external/agentlet/packages/protocol/src/messages.ts
apps/server/src/modules/agent/acp/harness-profile-discovery.ts
apps/server/src/modules/agent/acp/harness-profile-discovery.test.ts
apps/web/src/components/Settings/agent-profiles/CommandProfileForm.tsx
docs/architecture/agent-profiles.md
Related
Summary
Profiles automatically provisioned from agentlet harness discovery do not enable the harness catalogue's supported allow-all / auto-approval mode by default.
For example, agentlet correctly reports the GitHub Copilot recipe as:
but Huabu persists the automatic Profile command as:
instead of:
The resulting automatically discovered Profile can unexpectedly stop for tool approvals and does not provide the intended ready-to-use autonomous Agent behavior.
Confirmed cause
harness-profile-discovery.tsconstructs an automatic Profile with:It ignores
harness.autoApprove, even though that field is part of the versioned discovery contract and the trusted daemon-local catalogue. The existing discovery test explicitly expectscopilot --acp, preserving the incorrect behavior.The manual Profile form already has the canonical ordering logic:
before-acp:binary + autoApprove.args + acpArgsafter-acp:binary + acpArgs + autoApprove.argsExpected behavior
autoApproveis non-null.copilot --acp --allow-all.before-acpordering.autoApprove: nullremain unchanged; Huabu must not invent undocumented permission flags.Existing automatic Profiles
Define a safe migration/reconciliation policy for Profiles already created without the catalogue recipe:
customData.discoveredAgentprovenance whose launch command still matches the exact previously generated default.If the current Profile registry intentionally makes launch identity immutable, add an explicit registry-owned migration mechanism rather than bypassing that boundary.
Acceptance criteria
before-acp/after-acpordering.autoApprovefor every harness with an official recipe.docs/architecture/agent-profiles.mddocuments the automatic Profile permission-mode default and migration behavior.Relevant code
external/agentlet/packages/local/src/harnesses/catalogue.tsexternal/agentlet/packages/protocol/src/messages.tsapps/server/src/modules/agent/acp/harness-profile-discovery.tsapps/server/src/modules/agent/acp/harness-profile-discovery.test.tsapps/web/src/components/Settings/agent-profiles/CommandProfileForm.tsxdocs/architecture/agent-profiles.mdRelated