Skip to content

Hand off big one-time jobs from chat to a durable workflow #1549

Open

Description

@paullizer

Summary

Part of #1543 (Phase 7). When a request is bigger than a chat plan can handle, the planner proposes a one-time durable workflow. Approve & run starts it, the plan ends, and Phase 6b posts the summary back into the chat.

User Value

"Review these 200 documents against our checklist" doesn't fit in a plan: 8 steps by default and 30 at most, 900 s per run by default, and no loops. Durable workflows have For each and Repeat, run for up to 24 hours, and recover from failures. The user gets the job done without building a workflow by hand.

Proposed Behavior

  • The planner detects work beyond plan limits and proposes a one-time durable workflow through the Phase 2 builder, using v3 For each where needed.
  • Approve & run starts it. Like Phase 5, the plan is forced to manual approval.
  • The builder sets the one-time workflow's alerts to notify-only, because the chat post-back is already the signal.
  • After it completes, the workflow is disabled automatically and marked as one-time in its provenance.

Acceptance Criteria

  • A 200-document review is handed off, runs durably, and posts one summary back into the chat.
  • The one-time workflow's alerts are notify-only, and it's disabled after it completes.
  • Functional tests, feature doc, release notes and config.py version.

Notes

Activity

  1. 5 remaining items

  2. paullizer commented on Oct 8, 2026

    @paullizer
    CollaboratorAuthor

    Phase 7 complete

    All three parts are merged into paullizer-react-v2-ui. The hand-off is behind Hand Off Large Work From Chat (enable_chat_orchestration_workflow_handoff), which is off by default.

    Acceptance criteria

    • A 200-document review is handed off, runs durably, and posts one summary back into the chat. functional_tests/test_workflow_handoff_end_to_end.py runs 3 and 200 documents through the real accept route, the durable runtime and runner (For each, then the report), the result store and reader, and 6b's delivery worker, and ends with one summary in the chat. Cosmos DB, the model, the per-document analysis, document listing and the lease heartbeat are faked. At 200 documents the report is read in pages of at most 100 records and 128 KiB.
    • The one-time workflow's alerts are notify-only, and it doesn't run again. Instead of being disabled after it completes, it's created disabled, with a manual trigger and two notify-only alert rules. The runtime records a one-time status when the run ends, and workflow_run refuses to start it again (workflow_one_time: "It was created for a single run. Open it in Workflows to run it again.").
    • Functional tests, the feature doc CHAT_ORCHESTRATION_WORKFLOW_HANDOFF.md, the fix doc WORKFLOW_HANDOFF_RESULT_LINEAGE_FIX.md, release notes and a version for each part. 7b adds Playwright coverage: test_v2_orchestration_workflow_handoff_card.py, test_v2_orchestration_workflow_handoff_plan.py and test_v2_orchestration_workflow_handoff_run_status.py.

    Verified from tests and review, not on a live tenant.

    Where it differs from the issue

    • There's no Approve & run button. The plan always needs manual approval, and then the hand-off card under the answer asks again. Accept creates the one-time workflow and queues its run, or Start its run appears if the workflow already exists. Edit opens it in the workflow editor, and saving accepts the edited version after a confirmation. Decline marks it Declined, and Try again appears after an error that can be retried.
    • The run's deadline is 24 hours. By default each user can start 5 hand-offs in any rolling 24 hours (Hand-offs from chat per user per day).
    • Loops are capped at 2,000 items. Only an all_matches document query that goes over the cap pauses the run.

    Validation on each PR's final head

    Follow-ups (not blocking)

    • The card shows no item count before Accept.
    • The bell has no row specific to a hand-off.
    • The paused text keys on the waiting reason paused, because a pause has no reason code.
    • Retry is hidden when the capability allowlist has workflow_handoff but not workflow_run.
    • The editor round-trip test needs npm ci in CI.
    • Three test gaps found by mutating 7b in review. Nothing fails if a 401 on an edited save is reported as a 400 instead of reaching the editor, if the URL Access check reads only the draft and not the save payload, or if Try again appears whatever state the re-read leaves.
    • Each report read re-proves the lineage, so reading a 200-document report makes 1,409 result-store loads. A proof cache is the likely fix.
    • 7a's 0.261.250 release note still says users can't accept a hand-off in the browser, which is no longer true.
    • Playwright teardown hits 11 errors from five URLs that Bring V2 User Settings to profile parity with an admin-style layout #1691 added and the tests don't stub. That's for paullizer-react-v2-ui to fix.
    • CodeQL notes still open on paullizer-react-v2-ui: #3976, #3977 and #3978 in Phase 7a: hand off large chat requests to a one-time workflow (server, 0.261.238) #1640's tests. The import cycle between functions_workflow_limits.py and functions_settings.py predates Phase 7 (#3523 to #3526). #4009 and #4010, on the same cycle, were first reported right after Phase 7a: hand off large chat requests to a one-time workflow (server, 0.261.238) #1640 merged, on import lines older than it.

    This issue is ready to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1Priority 1: urgent, address before P2 workenhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions