Skip to content

Commit 5cfba46

Browse files
frantic-openaicodex
andcommitted
fix(app-server): identify MCP approval prompts
Summary: - Auto-answer only requestUserInput questions with the MCP approval ID marker. - Keep generic Allow/Deny option prompts blocked for operator input. Rationale: - Option labels alone are not a safe approval discriminator; ordinary tool prompts can also offer an Allow choice. - The existing Codex MCP approval question ID distinguishes the narrow prompt shape that Symphony may continue automatically. Tests: - red/green generic Allow/Deny tool-input regression - recognized MCP approval prompt regression - mise exec -- mix test test/symphony_elixir/app_server_test.exs - HEX_HOME=/private/tmp/symphony-hex mise exec -- make -C elixir all Co-authored-by: Codex <codex@openai.com>
1 parent 2f7b646 commit 5cfba46

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎elixir/lib/symphony_elixir/codex/app_server.ex‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,13 @@ defmodule SymphonyElixir.Codex.AppServer do
856856

857857
defp tool_request_user_input_approval_answer(%{"id" => question_id, "options" => options})
858858
when is_binary(question_id) and is_list(options) do
859-
case tool_request_user_input_approval_option_label(options) do
860-
nil -> :error
861-
answer_label -> {:ok, question_id, answer_label}
859+
if String.starts_with?(question_id, "mcp_tool_call_approval_") do
860+
case tool_request_user_input_approval_option_label(options) do
861+
nil -> :error
862+
answer_label -> {:ok, question_id, answer_label}
863+
end
864+
else
865+
:error
862866
end
863867
end
864868

‎elixir/test/symphony_elixir/app_server_test.exs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ defmodule SymphonyElixir.AppServerTest do
815815
;;
816816
4)
817817
printf '%s\\n' '{\"id\":3,\"result\":{\"turn\":{\"id\":\"turn-719\"}}}'
818-
printf '%s\\n' '{\"id\":112,\"method\":\"item/tool/requestUserInput\",\"params\":{\"itemId\":\"call-719\",\"questions\":[{\"header\":\"Choose an action\",\"id\":\"options-719\",\"isOther\":false,\"isSecret\":false,\"options\":[{\"description\":\"Use the default behavior.\",\"label\":\"Use default\"},{\"description\":\"Skip this step.\",\"label\":\"Skip\"}],\"question\":\"How should I proceed?\"}],\"threadId\":\"thread-719\",\"turnId\":\"turn-719\"}}'
818+
printf '%s\\n' '{\"id\":112,\"method\":\"item/tool/requestUserInput\",\"params\":{\"itemId\":\"call-719\",\"questions\":[{\"header\":\"Choose an action\",\"id\":\"options-719\",\"isOther\":false,\"isSecret\":false,\"options\":[{\"description\":\"Proceed with the requested action.\",\"label\":\"Allow\"},{\"description\":\"Do not proceed.\",\"label\":\"Deny\"}],\"question\":\"How should I proceed?\"}],\"threadId\":\"thread-719\",\"turnId\":\"turn-719\"}}'
819819
;;
820820
5)
821821
printf '%s\\n' '{\"method\":\"turn/completed\"}'
@@ -832,7 +832,8 @@ defmodule SymphonyElixir.AppServerTest do
832832

833833
write_workflow_file!(Workflow.workflow_file_path(),
834834
workspace_root: workspace_root,
835-
codex_command: "#{codex_binary} app-server"
835+
codex_command: "#{codex_binary} app-server",
836+
codex_approval_policy: "never"
836837
)
837838

838839
issue = %Issue{

0 commit comments

Comments
 (0)