Repository navigation
Find a sessionless driver's flow from a local run ledger - #1131
Conversation
The ledger entry is written before the start's poll lane, so it survives a harness abort: the server ignores MCP cancellations and still holds the id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
PR Summary by QodoRecover sessionless flows from a local run ledger
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62cdc84981
ℹ️ 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 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 address that feedback".
| /// <summary>Confirms each recorded run against the server, newest first; a run the server no | ||
| /// longer knows is skipped rather than read.</summary> | ||
| async Task<FlowRunIdResolution> ResolveFromRunLedgerAsync(HttpClient client, string apiRoot, string workspace, FlowRetryClock clock) { | ||
| var recorded = new FlowRunLedger(config, time).Recent(workspace, RunLedgerCandidates); |
There was a problem hiding this comment.
Search all retained runs before choosing a settled flow
When a sessionless workspace has six or more retained runs, this limits resolution to the five newest even though the ledger retains 50. If those five are closed, failed, or no longer known to the server while the sixth is still running or waiting, ChooseFlow returns a newer settled run or an error instead of the documented newest open flow. Continue through the retained entries until every possible open candidate has been ruled out, or otherwise avoid allowing the fixed probe limit to change which run is selected.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 747b74c: the lookup now confirms every entry the workspace retains (≤50) before choosing, so an open run behind newer settled or unknown ones is found. Test: An_older_open_run_behind_many_newer_settled_ones_is_still_found.
|
|
||
| if (resp.StatusCode == HttpStatusCode.Unauthorized) | ||
| return new(null, await AuthRejectionNotice.ForPersistentUnauthorizedAsync(store, profiles.Name, apiRoot, time)); | ||
| if (resp.StatusCode == HttpStatusCode.NotFound) continue; |
There was a problem hiding this comment.
Retry a newly recorded run before discarding a 404
When a successful start has just been recorded but the flow read model has not exposed its GET route yet, this immediately discards the newest candidate on a transient 404 and can return an older flow's status or claim that no recorded flow is known. The existing round poll explicitly gives initial 404s a NotFoundGrace window for this propagation case; ledger recovery needs equivalent bounded retry behavior before skipping the recorded run.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 747b74c: a 404 on a run recorded within NotFoundGrace (the start poll's own window) now answers "started moments ago — retry" instead of skipping it. Outside the grace a 404 is still skipped. Test: A_just_recorded_run_the_server_cannot_read_yet_is_a_retry_not_a_skip.
Code Review by Qodo
1.
|
A fixed probe count let newer settled runs hide an open one, and a 404 inside the start's not-found grace may only mean the server has not caught up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ows-run-ledger # Conflicts: # docs/CHANGES.md
…ows-run-ledger # Conflicts: # docs/CHANGES.md
Closes #1123 — AI-3146
What & why
Cursor, Copilot, Gemini, Kiro, OpenCode and Antigravity give the flows MCP server no session, so a bare
get_review_flow_status/get_flow_statusthere could not reach a run whose start the harness aborted. The flows server now records each run it starts without a session inflow-runs-v1.jsonunder the config root, keyed on repo root (or cwd). A sessionless bare status call reads that workspace's newest entries and confirms each withGET /api/flows/{id}, applying the same open/settled/several-open rule as the session lookup. Claude Code and Codex record nothing and keep the server-side lookup.Where to look
NotFoundGraceanswers "retry" instead of skipping.Verification
StatusWithoutFlowRunIdTests24/24,FlowRunLedgerTests6/6, integrationMcpFlowsServerTests36/36session_start_posts_to_session_start_route,Finds_the_PR_by_the_tracked_remote_name_when_the_local_name_misses) pass alonedotnet publish -c Release: no IL warnings🤖 Generated with Claude Code