Skip to content

feat: support Orka tool approvals in hosted agent calls - #5

Merged
Sertaç Özercan (sozercan) merged 1 commit into
mainfrom
human-approval-v2
Sep 20, 2026
Merged

Sertaç Özercan (sozercan) merged 1 commit into
mainfrom
human-approval-v2

Conversation

@sozercan

Copy link
Copy Markdown
Member

Orka reviews can outlast the bridge's existing 120-second HTTP timeout. Give MCP tools/call a 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: false envelope, 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:

  • A review stayed pending for more than 125 seconds with zero action executions while an independent Task completed. Approval then executed once and returned the receipt to the original conversation.
  • Decline, cancellation, and a real 600-second expiry kept execution at zero. An approved tool failure produced one failed attempt and the final safe error without a retry.
  • Restarting only the hosted AgentKit process preserved pending state and allowed the original approved continuation. Losing the Foundry supervisor while retaining the broker ledger blocked late execution and kept the count at zero.
  • Final approval, decline, and cancellation checks passed against the completed Orka integration, including delivery of the safe cancellation result.

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.

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>
Copilot AI balanced review requested due to automatic review settings September 14, 2026 21:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T21:53:43.507246Z 0cc604f PR opened
🔒 Security Review ✅ Completed 2026-09-14T21:54:47.135390Z 0cc604f PR opened
ℹ️ About Codex in GitHub

Your 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread internal/acp/config.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/call timeout 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.

@sozercan
Sertaç Özercan (sozercan) merged commit 9132fa7 into main Sep 20, 2026
5 checks passed
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