Skip to content

add Codex tool permission approval UI#98

Merged
RussellLuo merged 7 commits into
OpenCSGs:mainfrom
GatewayJ:codex/implement-codex-tool-permission-ui
May 22, 2026
Merged

add Codex tool permission approval UI#98
RussellLuo merged 7 commits into
OpenCSGs:mainfrom
GatewayJ:codex/implement-codex-tool-permission-ui

Conversation

@GatewayJ
Copy link
Copy Markdown
Collaborator

@GatewayJ GatewayJ commented May 21, 2026

Summary

  • Project Codex tool calls and permission requests as structured agent activity messages.
  • Add an in-memory Codex permission broker, decision API, and Web UI permission cards.
  • Update tool-call filtering and message rendering so structured tool activity can be hidden while pending permissions remain visible.

Why

Codex tool calls were previously rendered as plain text, and ACP permission requests were automatically allowed by the backend. This PR makes tool activity machine-readable in the IM timeline and lets users approve or reject Codex permission requests from the Web UI.

Validation

  • go test ./internal/runtime/codex ./internal/channel/codexbridge ./internal/api
  • pnpm --dir web/app test
  • pnpm --dir web/app typecheck

Note: pnpm reported the local Node version warning (wanted >=22.13.0 <25, current v26.0.0), but the test and typecheck commands completed successfully.

@GatewayJ GatewayJ marked this pull request as ready for review May 21, 2026 10:52
@GatewayJ GatewayJ force-pushed the codex/implement-codex-tool-permission-ui branch from 109b530 to 32f1224 Compare May 21, 2026 10:55
@GatewayJ GatewayJ changed the title [codex] add Codex tool permission approval UI add Codex tool permission approval UI May 21, 2026
@GatewayJ GatewayJ force-pushed the codex/implement-codex-tool-permission-ui branch from 32f1224 to 1ecefb5 Compare May 22, 2026 01:21
@GatewayJ GatewayJ force-pushed the codex/implement-codex-tool-permission-ui branch from 9012beb to 5cc3b7e Compare May 22, 2026 02:32
Comment thread internal/api/router.go Outdated
r.Post("/login", h.handleCLIProxyAuthLogin)
})
r.Post("/runtime/permissions/{request_id}/decision", h.handleRuntimePermissionDecision)
r.Post("/codex/permissions/{request_id}/decision", h.handleCodexPermissionDecision)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is standardizing permission decisions under the runtime API, keeping a second codex/permissions endpoint preserves the old abstraction boundary and leaves two public routes for the same operation. Unless there is an external compatibility requirement, I would drop this route and keep runtime/permissions as the only API surface.

GatewayJ added 3 commits May 22, 2026 11:35
…-tool-permission-ui

# Conflicts:
#	internal/api/bot_compat.go
#	internal/channel/codexbridge/bridge.go
#	internal/channel/codexbridge/bridge_test.go
#	internal/channel/codexbridge/render.go
#	internal/channel/codexbridge/sse_client.go
#	internal/im/bot_bridge.go
#	internal/im/service.go
#	web/app/src/hooks/workspace/useConversationController.ts
#	web/app/src/models/conversations.ts
#	web/app/tests/models/conversations.test.ts
@GatewayJ GatewayJ force-pushed the codex/implement-codex-tool-permission-ui branch 3 times, most recently from a295022 to d80e2f5 Compare May 22, 2026 07:00
@GatewayJ GatewayJ force-pushed the codex/implement-codex-tool-permission-ui branch from d80e2f5 to 6e176bd Compare May 22, 2026 08:36
Comment thread cli/serve/serve.go Outdated
return codexPermissionActivityDecider{permission: decider}
}

type codexPermissionActivityDecider struct {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adapter feels a bit too high in the stack for cli/serve.go. It is already carrying Codex-specific activity decision semantics rather than pure server wiring, so I would move it down next to the Codex runtime implementation (for example under internal/runtime/codex) and have serve.go only construct or reference it. That keeps the CLI/bootstrap layer thin now, and still leaves room to generalize later if another agent runtime needs the same activity interface.

@RussellLuo RussellLuo merged commit b98a397 into OpenCSGs:main May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants