[Bug]: OMP Terminal UI sessions ignore the configured permission mode (no --approval-mode)
Summary
The OMP Terminal UI adapter never passes the session permission mode to omp. GetLaunchCommand and GetRestoreCommand in backend/internal/adapters/agent/omp/omp.go forward the model and system prompt, then drop cfg.Permissions. The OMP Chat driver (ompacp) does map it, so the same project config launches OMP with different approval policies depending on the interface.
In practice OMP TUI sessions always run with whatever tools.approvalMode the user has in their global OMP settings, and a project's bypass-permissions, auto, or accept-edits has no effect.
A related surprise for anyone switching between the two: when a project leaves permissions unset, applySpawnAgentConfig fills in auto, and ompacp maps auto to --approval-mode write. OMP's own default is yolo. So Chat workers stop on every shell command for approval, while the same user's local OMP and AO's OMP TUI sessions never prompt. That mapping may be intended, but it makes the TUI gap easy to miss, because TUI sessions look like they "work" only because of the global OMP default.
Steps to reproduce
- Set a project's worker config to bypass:
ao project set-config <id> --config-json '{"worker":{"agent":"omp","agentConfig":{"permissions":"bypass-permissions"}}}' ao spawn --project <id> --mode chat --name chat-probe --prompt "Reply OK"ao spawn --project <id> --mode tui --name tui-probe --prompt "Reply OK"- Compare the two
ompprocess command lines.
Expected behavior
Both interfaces pass the same approval mode for the same resolved permission:
| AO permission | OMP flag |
|---|---|
default / unknown |
none (defer to OMP settings) |
accept-edits, auto |
--approval-mode write |
bypass-permissions |
--approval-mode yolo |
Actual behavior
Observed on the same project, same config:
# --mode chat
omp acp --model openai-codex/gpt-5.6-terra --append-system-prompt "..." --approval-mode yolo
# --mode tui
omp --extension <worktree>/.omp/extensions/ao-activity.ts --append-system-prompt "..." --model openai-codex/gpt-5.6-terra "Reply OK"
The TUI command has no --approval-mode. Restore (omp ... --resume <id>) has the same gap, from reading GetRestoreCommand.
A standalone Chat spawn with no permissions configured launched omp acp ... --approval-mode write, which matches the auto fallback described above.
Source at f6362255:
- TUI launch and restore with no permission handling: https://github.com/Untrivial-ai/agent-orchestrator/blob/f6362255108c6dc92c26ff8029f3a295e2bf614d/backend/internal/adapters/agent/omp/omp.go#L67-L115
- Chat mapping: https://github.com/Untrivial-ai/agent-orchestrator/blob/f6362255108c6dc92c26ff8029f3a295e2bf614d/backend/internal/adapters/chatdriver/ompacp/driver.go#L40-L55
- Empty permissions become
auto: https://github.com/Untrivial-ai/agent-orchestrator/blob/f6362255108c6dc92c26ff8029f3a295e2bf614d/backend/internal/session_manager/manager.go#L1935-L1952
Suggested fix
Move the ompApprovalMode mapping somewhere both packages can use it, and append --approval-mode <mode> in GetLaunchCommand and GetRestoreCommand whenever the mode is not default. OMP accepts the flag on both fresh and --resume launches. Table tests for all four modes on launch and restore, matching the existing ompacp driver tests, would keep the two paths from drifting again.
Not in scope here, but worth a look: #5954 reports ao spawn ignoring configured permissions. On this build, a CLI spawn did pick up bypass-permissions from project config in Chat mode, so that part may already be fixed.
AO version
Desktop 0.13.3-nightly.202610012317 (ao version prints dev). OMP 18.4.12.
Environment
Windows 11 (10.0.22631), x64. OMP installed via bun.
Before submitting
- [x] I searched existing issues for duplicates (#5954 and #4840 are related but cover
ao spawnresolution and the Codex mapping). - [x] No secrets, tokens, or private logs included.
Hey @illegalcall @somewherelostt I would want to work on this issue, please assign me the same if possible
Assigning this to @Shreyasnalle
@ApexYash11 done, raised a pr for this issue