Repository navigation
Conversation
…itOutcome and tool counts (ThinkFlowLab#449)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up fix to #681 addressing the
waitOutcomeand execution-record count edge cases raised in review (#681#pullrequestreview-6192347681):Record requested wait mode, duration, and satisfaction in
waitOutcome(gateway.py)wait_outcome()now recordswaitSeconds,until("all" | "any"forjob.status), andsatisfiedalongsidesettledandstatuses/status.satisfiedmatchesCreationCanvas.wait_jobs()/wait_item_status()semantics:waitSeconds <= 0(immediate status query):satisfied = True(never treated as an expired wait window).until == "any"with at least one terminal job (succeeded/failed/cancelled/interrupted):satisfied = Trueeven when other jobs are still running (settled = False).until == "all"withwaitSeconds > 0and unfinished jobs:satisfied = False,settled = False.settledsemantics stay unchanged for backward compatibility with saved records andscripts/trace_job_queries.py.Count completed calls by tool return status and separate expired waits from still-running observations (
assistantActivity.ts,AssistantReply.tsx,chat.ts,i18n,docs/architecture/agent-runtime.md)toolCounts()counts everystatus === "complete"call in{done}/{total} complete/{done}/{total} 已完成rather than subtracting successfuluntil="any",waitSeconds=0, or timed-outuntil="all"calls.waitOutcome.settled === falseare split into two mutually exclusive display states:unsettled(satisfied === false, expired wait window): row badgeNot finished/未结束(is-unsettled), summary{count} wait not finished/{count} waits not finished({count} 次等待未结束).jobsRunning(satisfied === true, e.g.,until="any"satisfied orwaitSeconds=0status query while jobs are still running): row badgeJobs running/仍有任务运行(is-jobs-running), summary{count} with jobs still running({count} 次返回时仍有任务运行).#681records withoutsatisfiedinferjobsRunningwhenarguments.waitSeconds === 0orarguments.until === "any"with a terminal status present, and older records withoutwaitOutcomeremainComplete/已完成.Add all three requested regressions
until="any"satisfied (1 succeeded + 1 running),until="all"wait window expired, andwaitSeconds=0zero-duration query across unit & POSIX transport tests (tests/test_wait_outcome.py), SSE/persistence reload tests (tests/test_assistant_conversations.py), frontend state tests (tests/assistantActivity.test.ts), and bilingual Playwright browser test (tests/browser/assistant_wait_outcome.mjs).Linked issue
Refs #449.
Fixes #NorRefs #Nis included, or no issue appliesLabels
Proposed:
type:bug,area:agent,area:canvas,area:i18n,area:docs(fork PR without label write permission).Test plan
92c468f4617d867ce1b8562fb7d61f93e70f058dover base322f98c317322c1ac12541093719c890507b51b0; byte-for-byte identical patch to4b48bf23over4cd524cewith zero overlapping files against#700):92c468f4:pytest tests/test_wait_outcome.py tests/test_assistant_conversations.py -k "wait_outcome or transport_records"(8 passed),node --test tests/assistantActivity.test.ts(7 passed),npm run check:i18n(3,866 keys, 0 problem(s)),npm run check:browser-manifest(OK, 113 entries),npm run check:browser-locale(102 page(s), 0 problem(s)).4b48bf23:pytest tests/test_wait_outcome.py tests/test_agent_gateway.py tests/test_assistant_conversations.py tests/test_trace_job_queries.py(79 passed, 0 failed),scripts/generate_contracts.py --check,lint-imports(4 kept, 0 broken),npx tsc --noEmit,npm test(1,118 passed, 0 failed),node --check tests/browser/assistant_wait_outcome.mjs,npm run build(3.95 s), and live in-app browser verification against an isolated real OpenDirector API + Vite dev server (Wait Mode Semantics Demo, verifieden-UScollapsed & expanded, fullpage.reloadpersistence, and live header language toggle tozh-CNwith zero cross-language leakage).Release checksworkflow (full repopytest tests, Playwright browser lanes includingtests/browser/assistant_wait_outcome.mjs, frontend checks), CodeQL, and DSH plugin checks on exact tip92c468f4617d867ce1b8562fb7d61f93e70f058d.322f98c317322c1ac12541093719c890507b51b0, head92c468f4617d867ce1b8562fb7d61f93e70f058d. Material validation gaps: hostedRelease checks/ CodeQL / DSH and full repopytesthave not yet run on92c468f4, full 79-test pytest / build / in-app browser walkthrough ran on the byte-for-byte identical patch4b48bf23prior to clean rebase onto322f98c3(zero overlapping files),playwright-coreis not installed locally sotests/browser/assistant_wait_outcome.mjsis left to CI Playwright lanes, and no live external model provider calls were made.Evidence that it works
In-app OpenDirector walkthrough video & bilingual screenshots (
4b48bf23)Captured directly in the running OpenDirector application (
create_appisolated backend + Vite frontend, projectWait Mode Semantics Demo) with a persisted 5-call turn written throughagent.py:until="all",waitSeconds=60, 2 running ->Not finished/未结束(is-unsettled)until="any",waitSeconds=60, 1 succeeded + 1 running ->Jobs running/仍有任务运行(is-jobs-running)waitSeconds=0, 1 running ->Jobs running/仍有任务运行(is-jobs-running)until="all",waitSeconds=60, 2 succeeded ->Complete/已完成(is-complete)project show(nowaitOutcome) ->Complete/已完成(is-complete)Before this fix, the same 5-call turn displayed as
2/5 complete · 3 returned before jobs finished/2/5 已完成 · 3 次返回时任务未结束, with rows 2 (until="any"satisfied) and 3 (waitSeconds=0query) both markedNot finished/未结束. With this fix, all 5 calls count as completed tool calls (5/5 complete/5/5 已完成), with summary5/5 complete · 1 wait not finished · 2 with jobs still running/5/5 已完成 · 1 次等待未结束 · 2 次返回时仍有任务运行.en-UScollapsed ->en-USexpanded ->en-USafterpage.reload->zh-CNcollapsed ->zh-CNexpanded):https://raw.githubusercontent.com/Redivesue/OpenDirector/935acbe7143d6899cf32246a73d73f26c524e14e/wait-modes-bilingual.mp4
Wait Mode Semantics Demo, right-hand AI Assistant expanded)en-USzh-CNProvider verification
No real-provider calls were made. All tests exercise local
ToolGateway, POSIX CLI transport, in-process ASGI conversation persistence, and frontend state/rendering fixtures.Bilingual UI
Both
zh-CNanden-USentries are updated together (assistant.reply.status.jobsRunning,assistant.reply.jobsRunningCount, and pluralizedassistant.reply.unsettledCount),tests/browser/assistant_wait_outcome.mjsand the live in-app walkthrough verify zero cross-language leakage, andnpm run check:i18npasses with 0 problems.Quick local verification case for reviewers
On this PR branch (
gh pr checkout 701):Expected highlights:
until="any"(1 succeeded + 1 running,waitSeconds=60) andwaitSeconds=0(1 running) both reportsatisfied: true, settled: false, count in5/5 complete/5/5 已完成, and render asJobs running/仍有任务运行rather thanNot finished/未结束.until="all"(waitSeconds=60, 2 running) reportssatisfied: false, settled: false, counts in5/5 complete/5/5 已完成, and renders asNot finished/未结束with summary1 wait not finished/1 次等待未结束.