Skip to content

feat(approvals): add human approval for v2 tool calls - #589

Merged
Sertaç Özercan (sozercan) merged 7 commits into
mainfrom
human-approval-v2
Sep 23, 2026
Merged

Sertaç Özercan (sozercan) merged 7 commits into
mainfrom
human-approval-v2

Conversation

@sozercan

@sozercan Sertaç Özercan (sozercan) commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Qualified AgentKit and Foundry harness-v2 runtimes can wait for human approval on the original MCP tool call and receive its actual result. An inventory lookup can finish while a proposed work order stays unexecuted until an authorized reviewer approves it.

The controller stores the executable request in an immutable, Task-owned Secret and binds the decision to the Task attempt, prompt, runtime, policy, and tool definition. Execution claims a durable effect record once. A saved receipt can replay; a started action with an uncertain outcome cannot execute again. Decline, expiry, cancellation, and stale authority return explicit outcomes without automatically resubmitting the prompt.

  • Bound review to 600 seconds, execution to 240 seconds, and the enclosing MCP call to 900 seconds, shortened by Task and prompt authority.
  • Require an explicitly qualified runtime profile and a default-off brokered approval capability. Native shell and file permissions remain separate.
  • Reuse the approval API and panel with safe input previews, deadlines, execution outcomes, reviewer authorization, and encoded approval IDs.
  • Preserve approved, unclaimed calls through temporary authority or storage read failures. Reject verified authority changes; cancel and preserve an unknown outcome if authority is lost after execution starts.
  • Recover pending and in-flight calls after controller or supervisor loss using original admission witnesses, retained runtime authority, durable receipts, and authenticated retirement proofs.
  • Add configuration guidance, a counted tool simulator, and a dedicated AgentKit/Foundry approval lifecycle E2E gate.

Split

This PR was rebuilt as the top of a stack. The unrelated work that rode along originally now lands separately:

  • fix/acp-cancellation-and-cleanup: proxy EOF, session base-dir mode, session delete retry, cancellation across proxy revocation.
  • feat/foundry-boot-recovery: Foundry boot retirement through the broker ledger.
  • test/e2e-cleanup-evidence (independent of this stack): E2E cleanup evidence harness.

The pre-split history is preserved on human-approval-v2-pre-split. Against that branch, the only code change here is the second commit: the CallBinding raw-field upgrade and the raw call-ID recovery identity branch are removed because no release ever wrote those forms, and five small helpers are shared between the broker and recovery paths. Everything else is byte-identical to the live-validated tree.

Remaining simplification follow-ups: the ExternalEffect Task-UID discovery label (written but only read by fallbacks for records without the spec field), the two denial receipt shapes, the continueApprovedCall shim, the 15-file approval test layout, and the acceptance runner living under examples/.

Validation

At the pre-split revision 2864ff69b: make lint-fix, make test, focused race/regression tests, and 67 fixture tests. The dedicated approval CI gate passed approval, decline, cancellation, reviewer authorization, full 600-second expiry, concurrent progress, supervisor loss, and pending/in-flight controller loss on both adapters. Both general E2E lanes passed all 81 selected specs.

All nine core images were deployed to sertac-aks in harness-v2 mode. Ten browser checks and the live approval scenarios passed on AgentKit and a real Azure kind: hosted agent, including approval holds over 125 seconds and the full expiry window. Live recovery passed two supervisor crashes and two controller crashes. All 29 acceptance Tasks, seven UI Tasks, and both runtime registrations completed normal cleanup.

Six historical crash Tasks from pre-fix validation remain retained because their original admission and deletion evidence is missing.

Current approval E2E dependencies: AgentKit 490bb6d6, merged through PR #27; Foundry runtime 9f994c30. The Foundry revision adds the separate response-acknowledgement cancellation fix on top of 32cd33f5. The gate's cancellation and recovery checks validate this combined dependency set; they do not qualify 32cd33f5 alone.

Setup guide.

Closes #582.

Copilot AI balanced review requested due to automatic review settings September 14, 2026 21:48
@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-23T18:44:27.722445Z 0bf4efb New commits
🔒 Security Review ✅ Completed 2026-09-14T21:56:34.621593Z 6b0aaf4 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: 6b0aaf45ac

ℹ️ 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/controller/acp_mcp_approval.go Outdated
Comment thread internal/controller/acp_mcp_approval.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Approval outcomes can remain permanently stale after a controller crash between durable effect and event writes.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced (auto)
Findings: 1 High severity · 1 Low severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open findings (2)
What changed in this PR

Adds durable, controller-owned human approval for exact MCP tool calls from qualified AgentKit and Foundry v2 runtimes.

Changes:

  • Persists approval requests, decisions, execution evidence, and replay-safe effects.
  • Adds runtime capability gating, lease handling, cancellation behavior, and UI support.
  • Provides documentation, simulators, acceptance tooling, and broad automated coverage.
File Description
workers/​acp/​supervisor/​server.go Gates approval sessions by capability.
workers/​acp/​supervisor/​prompt_handlers.go Separates permissions from approval authority.
workers/​acp/​supervisor/​permission_policy_test.go Tests one-shot permission behavior.
workers/​acp/​supervisor/​native_permission_test.go Updates brokered permission tests.
workers/​acp/​supervisor/​mcp_proxy.go Proxies long-running approval calls.
workers/​acp/​supervisor/​mcp_proxy_test.go Removes superseded local-grant tests.
workers/​acp/​supervisor/​mcp_proxy_errors_test.go Tests approval outcome preservation.
workers/​acp/​supervisor/​mcp_proxy_approval_test.go Tests proxy approval lifecycle.
workers/​acp/​supervisor/​foundry_provider.go Enables qualified Foundry approvals.
workers/​acp/​supervisor/​foundry_broker_test.go Tests Foundry approval projection.
workers/​acp/​supervisor/​env.go Adds profile-qualified capability opt-in.
workers/​acp/​supervisor/​env_test.go Tests qualification and drift rejection.
workers/​acp/​supervisor/​brokered_approval_capability_test.go Tests capability admission.
workers/​acp/​supervisor/​agentkit_provider.go Configures AgentKit’s extended timeout.
workers/​acp/​supervisor/​agentkit_provider_test.go Tests AgentKit approval support.
website/​docs/​reference/​execution-events.md Documents approval execution events.
website/​docs/​guides/​human-approval-v2.md Adds operator and reviewer guide.
website/​docs/​development/​agent-runtime-adapter-contract.md Defines adapter approval contract.
ui/​src/​schemas/​execution-event.ts Parses approval execution metadata.
ui/​src/​components/​tasks/​task-approval-panel.tsx Displays previews and outcomes.
ui/​src/​components/​tasks/​task-approval-panel.test.tsx Tests approval presentation.
manifest_staging/​charts/​orka/​crds/​agentruntime-customresourcedefinition.yaml Stages expanded approval policy schema.
internal/​harness/​v2/​protocol.go Adds brokered-approval capability.
internal/​harness/​v2/​mcp.go Defines approval timeouts and authority rules.
internal/​harness/​v2/​mcp_test.go Tests controller-owned approval validation.
internal/​harness/​v2/​conformance/​conformancetest/​server.go Advertises approval capability in fixtures.
internal/​harness/​v2/​conformance/​check.go Enforces approval capability conformance.
internal/​harness/​v2/​conformance/​check_test.go Tests capability requirements.
internal/​events/​execution_event.go Adds approval execution event type.
internal/​events/​execution_event_test.go Covers the event taxonomy.
internal/​controller/​acp_mcp_prompt_lease.go Tracks live approval prompt leases.
internal/​controller/​acp_mcp_prompt_lease_test.go Tests lease identity and expiry.
internal/​controller/​acp_mcp_prompt_lease_lifecycle_test.go Tests lease lifecycle races.
internal/​controller/​acp_mcp_policy.go Allows qualified runtime policies.
internal/​controller/​acp_mcp_policy_test.go Updates policy rejection coverage.
internal/​controller/​acp_mcp_broker.go Integrates approval execution and authority.
internal/​controller/​acp_mcp_approval.go Implements durable approval settlement.
internal/​controller/​acp_mcp_broker_test.go Tests approval prompt authorization.
internal/​controller/​acp_mcp_broker_errors_test.go Tests bounded execution failures.
internal/​controller/​acp_mcp_approval_test.go Tests persistence, replay, and denial.
internal/​controller/​acp_external_runtime_policy_isolation_test.go Wires approval dependencies in tests.
internal/​controller/​acp_external_runtime_dispatch_test.go Tests cancellation settlement.
internal/​controller/​acp_dispatcher.go Registers leases and revalidates capabilities.
internal/​controller/​acp_dispatcher_test.go Updates lease and permission tests.
internal/​controller/​acp_brokered_approval_capability_test.go Tests runtime capability drift.
internal/​approvals/​approvals.go Derives bindings and execution outcomes.
internal/​api/​internal_execution_event_handlers.go Rejects worker-owned execution updates.
internal/​api/​internal_execution_event_handlers_test.go Tests event submission rejection.
internal/​api/​approval_handlers.go Validates bound v2 decisions.
examples/​human-approval-v2/​tools.yaml Defines simulated tools.
examples/​human-approval-v2/​test_simulated_tools.py Tests durable execution counts.
examples/​human-approval-v2/​test_acceptance.py Tests acceptance validators.
examples/​human-approval-v2/​task.yaml Defines the example Task.
examples/​human-approval-v2/​simulator.yaml.example Provides simulator deployment.
examples/​human-approval-v2/​simulated_tools.py Implements the counted simulator.
examples/​human-approval-v2/​README.md Documents end-to-end setup.
examples/​human-approval-v2/​profile/​main.go Renders immutable runtime profiles.
examples/​human-approval-v2/​foundry-acp.json Supplies Foundry configuration.
examples/​human-approval-v2/​agents.yaml Defines example runtime Agents.
examples/​human-approval-v2/​agentkitfile.yaml.example Supplies direct AgentKit configuration.
examples/​human-approval-v2/​agent-hosted.yaml.example Supplies hosted AgentKit configuration.
examples/​human-approval-v2/​acceptance.py Runs deployed acceptance scenarios.
config/​crd/​bases/​core.orka.ai_agentruntimes.yaml Expands the generated CRD policy.
cmd/​main.go Wires shared leases and event storage.
api/​v1alpha1/​agent_runtime_crd_types.go Exposes approval-required tools in the API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/controller/acp_mcp_approval.go
Comment thread website/docs/guides/human-approval-v2.md Outdated
Copilot AI review requested due to automatic review settings September 14, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Approval recovery introduces an unbounded per-dispatch scan of historical effects and every Agent Task in affected namespaces.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced (auto)
Findings: 1 Medium severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open (1)
Resolved since last review (2)

Comment thread internal/controller/acp_external_effect.go Outdated

@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: f40a212cf3

ℹ️ 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/controller/acp_mcp_approval_recovery.go
Comment thread internal/controller/acp_mcp_approval_recovery.go
Comment thread internal/events/execution_event.go
Copilot AI review requested due to automatic review settings September 14, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Recovery introduces an unbounded per-Task query path in the dispatcher, and one updated rejection message is inaccurate.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced (auto)
Findings: 1 Medium severity · 1 Low severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open (2)
Resolved since last review (1)

Comment thread internal/controller/acp_mcp_approval_recovery.go Outdated
Comment thread internal/controller/acp_mcp_broker.go Outdated

@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: d6972c3aaa

ℹ️ 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/controller/acp_mcp_approval.go
Copilot AI review requested due to automatic review settings September 15, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive, distributed exact-once workflow warrants final human review, and encoded approval IDs still lack API-level regression coverage.

Review tier: Balanced (auto)
Findings: None

Note

Copilot is running an experiment and ran this review at Balanced.

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Cover encoded approval IDs in the decision API

internal/​api/​approval_handlers.go:76

This new decoding path has no API test with an approval ID that actually requires path encoding. Plain IDs do not verify that Fiber preserves the encoded segment and that it is unescaped exactly once. Add a handler test using characters such as /, %, or spaces and assert the decision resolves the original approval record.

Copilot AI review requested due to automatic review settings September 20, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The approval event currently exposes a runtime-controlled call ID that may contain sensitive URL or query text.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread internal/controller/acp_mcp_approval.go Outdated
Copilot AI review requested due to automatic review settings September 21, 2026 01:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Approval persistence and effect-reservation failures are incorrectly reported as action conflicts, obscuring retryable infrastructure failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread internal/controller/acp_mcp_approval.go
Copilot AI review requested due to automatic review settings September 21, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive, cross-runtime approval and recovery protocol spans 86 files and still requires final human review despite extensive tests.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 21, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Transient backend failures can irreversibly consume approvals, and the new capability field breaks approval-free rolling compatibility.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 1 Medium severity

Open (3)

Comment thread internal/controller/acp_mcp_approval.go Outdated
Comment thread internal/controller/acp_mcp_approval.go Outdated
Comment thread internal/harness/v2/protocol.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive, exactly-once approval and crash-recovery protocol spans 135 files and requires final human validation despite extensive automated coverage.

Review effort: Balanced
Findings: None

@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: 74c46e7fc4

ℹ️ 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/controller/acp_mcp_approval.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The example still selects a mutable AgentKit frontend despite requiring immutable qualification inputs.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread examples/human-approval-v2/agentkitfile.yaml.example Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive approval, recovery, and exactly-once execution changes span 135 files and warrant final human validation despite extensive automated coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The exactly-once execution and recovery changes span 135 files and external runtime contracts, so final human review is warranted despite no newly verified defects.

Review effort: Balanced
Findings: None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The cross-cutting authorization, durable-effect, crash-recovery, API, and runtime changes require final human validation despite extensive coverage.

Review effort: Balanced
Findings: None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The dedicated lifecycle workflow can be skipped when either repository-local setup action changes.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread .github/workflows/human-approval-v2-e2e.yml

@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: d0cb08f39f

ℹ️ 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/controller/acp_mcp_approval.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The cross-controller exactly-once execution, recovery, and authorization changes are security- and reliability-critical despite extensive coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive distributed execution, recovery, and authorization changes warrant final human review despite extensive automated coverage.

Review effort: Balanced
Findings: None

@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: 20e6452591

ℹ️ 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/controller/acp_mcp_policy.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Non-approved terminal outcomes currently produce misleading “Approved tool execution” audit summaries.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread internal/controller/acp_mcp_approval.go Outdated
Qualified AgentKit and Foundry harness-v2 runtimes can wait for human
approval on the original MCP tool call and receive its actual result.
The controller stores the executable request in an immutable, Task-owned
Secret and binds the decision to the Task attempt, prompt, runtime,
policy, and tool definition. Execution claims a durable effect record
once. A saved receipt can replay; a started action with an uncertain
outcome cannot execute again. Decline, expiry, cancellation, and stale
authority return explicit outcomes without resubmitting the prompt.

- Bound review to 600 seconds, execution to 240 seconds, and the
  enclosing MCP call to 900 seconds, shortened by Task and prompt
  authority.
- Require an explicitly qualified runtime profile and a default-off
  brokered approval capability. Native permissions stay separate.
- Reuse the approval API and panel with safe input previews, deadlines,
  execution outcomes, reviewer authorization, and encoded approval IDs.
- Preserve approved, unclaimed calls through temporary authority or
  storage read failures. Reject verified authority changes; cancel and
  preserve an unknown outcome if authority is lost after execution
  starts.
- Recover pending and in-flight calls after controller or supervisor
  loss using original admission witnesses, retained runtime authority,
  durable receipts, and authenticated retirement proofs.
- Add configuration guidance, a counted tool simulator, and a dedicated
  AgentKit/Foundry approval lifecycle E2E gate.

Split from the original human-approval-v2 branch: the cancellation and
session cleanup fixes, Foundry boot recovery, and the E2E cleanup
evidence harness now land in their own pull requests.
No release ever wrote approval events with raw runtime identifiers or
call IDs under the pre-digest identity domain; those forms only existed
on earlier revisions of this branch. Remove the CallBinding raw-field
upgrade and the raw-call-ID recovery branch along with their tests.

Share one detached settlement context helper, one poll-interval
default, one ApprovalExecutionUpdated payload type, one projection
currency predicate, and one current-Task reader between the broker and
recovery paths.
…uest

An exact redelivery that finds a terminal effect already has its
ApprovalRequested event from the original delivery. Appending it again
made the replay depend on event-store availability and returned 503
instead of the verified durable receipt during a transient outage.
Record the request only for an unstarted effect.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
The example agentkitfile pulled a mutable frontend tag through its
syntax directive, which BuildKit resolves before any build argument, so
the documented immutable-build requirement could not be met. Use a
required digest placeholder and say so in the README.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
An approved brokered wait_for_tasks call inherits the four-minute
execution budget as its context deadline, but the tool's own default
wait is ten minutes, so the budget cancelled it and the call was
recorded as an unknown outcome instead of returning its in-progress
result. Clamp the wait to the caller's context deadline.

Also run the approval E2E gate when the shared free-disk-space or
setup-kind actions change.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The security-sensitive approval, execution, recovery, and cleanup paths span 137 files and warrant final human review despite extensive automated coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

The E2E gate validates a later Foundry cancellation commit rather than the companion revision and split scope declared by the PR.

Review effort: Balanced
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Gate validates the wrong Foundry companion revision

scripts/​human-approval-v2-e2e.sh:45

The dedicated gate is not validating the Foundry companion revision advertised by this PR (32cd33f5). It instead builds 9f994c30, whose change is the separately split cancellation/response-acknowledgement fix, so cancellation and recovery scenarios can pass because of code explicitly described as out of this PR's stack. Pin the declared companion revision here, or update the dependency/PR description and gate scope so the validation result accurately identifies the required Foundry contract.

@sozercan

Copy link
Copy Markdown
Member Author

Addressed the Foundry dependency note in this review. The description now identifies the gate's actual Foundry pin, 9f994c30, from scripts/human-approval-v2-e2e.sh:45, including its separate response-acknowledgement cancellation fix. The cancellation and recovery checks validate that combined dependency set; this gate does not qualify 32cd33f5 alone. No code or dependency pin changed.

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.

Add human approval for tools used by Orka v2 agents

3 participants