Skip to content

Return WorkflowStartResult from Workflow.start()#34

Closed
czpython wants to merge 3 commits into
mainfrom
eng/workflow-start-result
Closed

Return WorkflowStartResult from Workflow.start()#34
czpython wants to merge 3 commits into
mainfrom
eng/workflow-start-result

Conversation

@czpython

Copy link
Copy Markdown
Owner

T2 of the MCP arc (spec: tmp/mcp-arc-tickets.md). start() now returns WorkflowStartResult(run_id, is_duplicate) so dispatch surfaces can tell a fresh enqueue from the subject's already-live run — the fact the agent-facing dispatch route (T3) needs to report duplicate-as-success. is_duplicate is sourced only from the DBOSQueueDeduplicatedError catch; the terminal-holder recursion path propagates the recursive call's result; no preflight reads, no compat shim. Dispatch callers keep their string contracts via .run_id.

Test evidence: dedup tests now pin both flags (test_duplicate_start_returns_the_live_run, test_duplicate_start_shares_the_run_across_accounts); ~30 assertion sites updated across the four durable test files; ruff + format clean, pyright error multiset identical to main's baseline; backend suite runs in CI.

Merge gate: druks-discovery companion prepared locally on eng/workflow-start-result-companion @ f33f7de (not pushed) — coordinate before merging this.

czpython added 3 commits July 19, 2026 02:23
start() hands back the run to follow plus is_duplicate, sourced only from
the DBOSQueueDeduplicatedError catch; the terminal-holder recursion path
propagates the recursive call's result. Dispatch callers keep their string
contracts via .run_id, the dedup tests pin both flags, and the author guide
carries the one-line migration note. Touched files also brought to the
house checklist: bare guard returns and positive input branching.
The surface test pins the new export, and every test double standing in
for start() hands back the model — including the two whose callers
discard the return, so the stubs stay shape-faithful.
@czpython

Copy link
Copy Markdown
Owner Author

Closing: cutting is_duplicate removes the whole of this PR. No consumer ever branched on the flag — the agent dispatch reply only formatted a note from it — and it cost a platform-primitive return-type change (start() -> str → a new model) across every caller and ~40 test sites. start() stays a bare run-id string; safe blind dispatch is unchanged (that's DBOS queue dedup, not this field), and the agent dispatch reports one idempotent note.

The removal landed on the two stacked PRs: #36 (0d91b92d) and #37 (88579449). The druks-discovery companion is moot and discarded — with T2 gone, that repo needs no change.

@czpython czpython closed this Jul 19, 2026
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.

1 participant