feat: support Orka tool approvals in hosted agent calls - #5
Conversation
Keep MCP tool calls open for the Orka approval window while preserving model and discovery deadlines. Forward safe final approval outcomes to AgentKit and verify cancellation, counted execution, and fenced continuation. Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cc604fb6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Cross-service approval authority and recovery behavior warrant human validation, especially with live Azure gateway behavior still unverified.
Review tier: Balanced
Findings: None
What changed in this PR
Adds hosted Orka tool-approval support while preserving broker ownership and AgentKit continuation semantics.
Changes:
- Extends
tools/calltimeout to 900 seconds while retaining 120-second defaults elsewhere. - Safely maps six Orka final error codes into AgentKit envelopes.
- Adds approval lifecycle, cancellation, recovery, and concurrency coverage plus deployment guidance.
| File | Description |
|---|---|
internal/acp/config.go |
Defines transport timeouts. |
internal/acp/mcp.go |
Applies method-specific HTTP deadlines. |
internal/acp/approval_test.go |
Tests held approvals and failure paths. |
internal/broker/agentkit.go |
Normalizes safe Orka outcomes. |
internal/broker/agentkit_test.go |
Tests error mapping and isolation. |
internal/broker/agentkit_integration_test.go |
Extends hosted integration coverage. |
internal/broker/approval_test.go |
Tests lease and restart ownership. |
docs/harness-v2.md |
Documents support, limits, and acceptance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Orka reviews can outlast the bridge's existing 120-second HTTP timeout. Give MCP
tools/calla separate 900-second budget for up to 600 seconds of review, 240 seconds of approved execution, and result delivery. Model and discovery requests keep their 120-second limit. The original call waits for one final result, bounded by cancellation and live ownership; it does not send an interim result or replay the prompt.Preserve Orka's six allowlisted approval and execution error codes in AgentKit's final
approved: falseenvelope, using fixed safe messages. Successful calls retain the actual tool result and original continuation identity. Add counted coverage for held reviews, distinct decisions, concurrent sessions, cancellation, lost results, ownership expiry, and broker restart. Document the qualified provider combination and required hosted session/state lifetimes.Completed local acceptance with Orka's real v2 Task and approval APIs, the Foundry bridge, and the production hosted AgentKit process:
This acceptance used local Kubernetes and fixture Azure identity/session transport. Deployed Azure gateway forwarding and Foundry session idle behavior remain unverified; the configured Azure deployment still needs the live acceptance check described in #4.
Refs #4 and orka-agents/orka#582.
Companion changes: orka-agents/orka#589 and sozercan/agentkit#27.