docs: refine Durable agent loop architecture and delivery plan - #234
Laveesh Rohra (larohra) merged 13 commits into
Conversation
Record review findings and preserve whole-run timeout, key-scoped ownership, and inbound MCP design intent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The FRD has unresolved scope, function-key authorization, MCP registration, and delivery-sequencing inconsistencies.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Refines FRD 0009’s Durable agent-loop architecture and staged delivery plan.
Changes:
- Defines policy, timeout, ownership, retry, and Entity-history behavior.
- Adds Durable-aware MCP design and registration accounting.
- Splits implementation into gated delivery slices.
| File | Description |
|---|---|
docs/frds/0009-durable-agent-loop.md |
Expands the architecture, decisions, qualification gates, and delivery plan. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Tsuyoshi Ushio (TsuyoshiUshio)
left a comment
There was a problem hiding this comment.
Overall LGTM. leave non-blocking suggestions and questions.
Defer inbound MCP and track fast-follows, co-locate keyed HTTP operations, preserve sessions across user-managed deployments, and consolidate usable core delivery. Include timeout and recovery clarification from architecture review. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The optional UI behavior and authored HTTP route transformation remain insufficiently defined for implementation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Authentication, UI bootstrap, quarantine, identity, and module-boundary contracts remain insufficiently resolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (5)
Deployment identity and migration behavior are unspecified · New Missing quarantine state for unfinished external calls · New Authentication incorrectly resolves per agent instead of per entry · New Durable engine depends on workflow-specific bridge internals · New Page dispatcher auth blocks anonymous bootstrap · New
Resolved since last review (2)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The per-entry HTTP registration contract assigns colliding function names when an agent exposes built-in and authored entries.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (5)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hallvictoria
left a comment
There was a problem hiding this comment.
Architecture review follow-up: six design questions that appear unresolved before implementation.
|
FYI only — not a change request and not a blocker. I am OK to approve this PR. I wrote this summary of the Durable agent API (FRD 0009 §4.2–§4.13, head
1. How to enable (front matter)---
name: Researcher
builtin_endpoints:
chat_api: true # management paths are in the same function
durable:
enabled: true # shorthand: durable: true
limits: # optional; no defaults
max_model_steps: 24
max_tool_calls: 48
history:
session_ttl: P10D # required; ISO-8601 fixed units only
sandbox_group: # optional; added in C3
resource_id: $SANDBOX_GROUP_RESOURCE_ID
region: $SANDBOX_GROUP_REGION
disk: python-3.13 # mutually exclusive with disk_id
---
2. Endpoints (under
|
| Method and path | Purpose |
|---|---|
POST /chat (or the authored HTTP route R) |
Accept a turn. Returns 202, not a synchronous answer |
GET /manage/runs/{run_id} |
Status, result or pending question (polling) |
POST /manage/runs/{run_id}/cancel |
Idempotent, best-effort cancellation |
POST /manage/runs/{run_id}/input/{question_id} |
Idempotent answer to the stored question |
GET /manage/sessions |
Owner-scoped, paginated session list |
GET /manage/sessions/{session_id}/history |
Conversation from the Entity (authoritative) |
DELETE /manage/sessions/{session_id} |
Start deletion; a repeated call returns the same progress |
GET /manage/runs/{run_id}/events |
Optional SSE; not required for v1 |
For an authored route R, management is below R/manage/... (for example, orders/acme/ask/manage/runs/<id>).
3. Request parameters
| Item | Location | Rule |
|---|---|---|
Idempotency-Key |
Header (required) | [A-Za-z0-9._-]{1,128}, case-sensitive. Missing → 400. Use the same value on retry |
x-ms-session-id |
Header (optional) | Continues a session. If absent, the session ID is derived from the key |
session_id |
Body root (optional) | Must agree with the header, else 400 |
| Credential | x-functions-key / code / Entra |
Conflicting carriers → 400 ambiguous_credential |
4. Responses
| Case | Response |
|---|---|
| Accepted | 202 with session_id, run_id, request_id, relative status links and the x-ms-session-id header |
| Same key, same body | The original receipt; no new turn |
| Same key, different body | 409 idempotency_conflict |
| Another turn is active in the session | 409 session_busy (no queue) |
| Deleted session | 410 |
| Capacity exhausted | 429 / 503 |
| Answer to a closed question | 410 (a conflicting answer is 409) |
| Deletion progress | 202 pending / 200 completed / 500 failed |
Terminal turn states include completed, failed, cancelled, timed_out, start_unconfirmed and outcome_unknown.
5. What it can do
- Long-running turns with one checkpoint for each model step and each tool call. A turn continues after a crash or a redeployment.
- Parallel tool calls. Results are recorded in the original call order.
- Human-in-the-loop: the agent calls
request_human_input, the run waits, and an answer resumes the same run. - Multi-turn sessions through
session_id. History is on the server, so another client can restore it. - Cancellation, deletion and idle TTL.
- Owner isolation for each Entra principal or each function key.
- The existing debug UI polls Durable runs automatically.
6. Typical flow
POST /agents/researcher/chat (Idempotency-Key: k1) → 202 {session_id, run_id, status link}
GET .../manage/runs/{run_id} → running / question / result
POST .../manage/runs/{run_id}/input/{question_id} → only if there is a question
POST /agents/researcher/chat (x-ms-session-id: <id>, Idempotency-Key: k2) → next turn
Not in v1
Inbound MCP (FF1), Timer and other non-HTTP triggers, workflow/subagent composition, synchronous streaming (chatstream).
|
Non-blocking observations — not blockers. I am OK to approve this PR as it is. You can handle these items in C2 or later, or you can reply that they are out of scope. I compared the FRD (head 1.
|
Tsuyoshi Ushio (TsuyoshiUshio)
left a comment
There was a problem hiding this comment.
LGTM. My two comments (API summary and Durable-native observations 1-4) are non-blocking. They are FYI and follow-up suggestions only, not change requests.
Tsuyoshi Ushio (TsuyoshiUshio)
left a comment
There was a problem hiding this comment.
Commented but non-blocker to make progress. LGTM.
daec873
into
feature/durable-agent-loop



Purpose
Refine FRD 0009 (#226) into a usable Durable v1 design and delivery plan, incorporating architecture review and human decisions.
Does this introduce a breaking change?
Documentation-only design revision; no runtime behavior changes here.
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
Documentation-only; no runtime tests or cloud qualification performed in this PR. Single-step harness/skills verification is a separate, nonblocking investigation; breaking findings will be addressed in a follow-up PR rather than silently dropping capabilities.
What to Check
Verify that the following are valid
Other Information
Targets
feature/durable-agent-loop, notmain; C0 test-only characterization is stacked in #235. Status remains In review pending final architecture sign-off. This PR does not authorize cloud execution or claim production qualification.