Repository navigation
Description
Summary
Work can remain durably associated with a conversation while its tools report that no Work is bound. Work execution can then proceed through ordinary tools without being attributed to the existing task graph, leaving the graph out of sync with the actual result. Tool selection, plan editing, and high-frequency observation add further friction and load.
The goal is reliable, simple continuation and accurate information for the model and user. Work should add value for a task; it should not create an independent workflow that users or agents must manually repair.
Observed behavior and evidence
Work binding is not consistently available across turns
- A Work was created and its conversation binding remained readable from the server.
- On a subsequent turn, an explicit
run_next_work_itemcall was rejected with “No canonical Work is bound to this session.” - The admission check reads the current executor's in-memory binding before dispatch. The Work handler's existing lazy binding resolution is therefore not reached when the executor has not yet loaded an otherwise valid durable binding.
- An inspection call later resolved the same Work, after which Work control could proceed.
The binding being present is not by itself authorization to capture every unrelated follow-up. The defect is that an explicit request to continue Work can be rejected before the existing binding is resolved.
Relevant owners: crates/runtime/src/server/server_loop_host.rs, crates/runtime/src/server/runtime_tool_executor.rs, and crates/runtime/src/server/tool_work_lifecycle.rs.
Task graph and actual work diverge
- After the Work-control rejection, the requested external operations were completed through ordinary shell tools with no Work attribution. The task graph still showed pending/recovery work.
- Only after the user asked about active Work did the agent inspect the graph, revise the remaining task descriptions to reflect already-completed work, and settle them.
- The four concrete tasks subsequently showed delivered, while the retained Work was still active and its overall delivery was
criteria_not_acceptedwith no accepted criteria. Retained Work, an executing task, and a verified delivery are different facts; an active retained record does not prove that a process is still running. - A request for a long-lived external tracking issue also led the model to establish an internal durable Work. The user did not explicitly ask to create an internal Work. This is an observed model choice, not evidence that every such request is forced into Work.
Work tools expose internal coordination failures
- An earlier selection of
inspect_work_planwas rejected because its provider binding was considered stale; selecting the tool again succeeded. The reported descriptor fingerprints differed, but the evidence does not establish whether the underlying provider actually changed or whether an internal identity changed across turns. propose_work_planwas called with a Work ID where the schema requires a context ID. The error said that the plan changed, even though the submitted identity was not the required kind. The model made an invalid call; the opaque identity contract and misleading classification made recovery harder.- Valid authority and optimistic-concurrency checks must remain. Reduce accidental dependence on internal IDs and needless reselection without blindly applying an outdated graph mutation.
User authorization and internal workflow are not consistently integrated
For a concrete, explicitly requested issue-management task, an automatically selected triage workflow required a frozen plan, multiple hashes, and another approval before any write. After the user reiterated the request, ordinary shell operations completed outside the original Work attribution.
This is not evidence of unauthorized writes: the user had requested the operations. It shows that a broad workflow can impose ceremony on a narrow task while the actual tool path and Work state are not governed by the same context. Internal hashes, attempt IDs, and planning mechanics should not become routine user-facing requirements.
Work observation creates recurring load
While the Work graph was waiting for attention, one visible client fetched the conversation binding and task graph approximately every two seconds. In a 43-second interval, server access logs recorded 21 requests to each endpoint. The client falls back to a 30-second interval for a quiet bound view; an explicitly selected Work may continue at the active interval.
For 1,000 concurrently connected clients actively observing Work, this extrapolates to roughly 500 refreshes and at least 1,000 HTTP requests per second, before pagination. This is an estimate from observed refresh behavior, not a measured SQL query count or a claim that every active conversation has such a viewer. Both paths read server-owned Work data; establish the actual database cost separately.
Relevant owners: crates/astra-cli/src/tui/plan_task_observer.rs and the existing Work event and task-graph projection paths.
Tool repetition controls can obstruct useful inspection
A long review produced seven rejected read_file calls because identical calls exceeded the repeat limit. The returned message contained only a short cached excerpt. In one child execution, rejections in consecutive model rounds advanced from call 4 to call 5, although the cache intends to reset call counts when authoritative provider-round feedback advances. The evidence does not establish why that reset did not occur.
One cached result was already an automatically downgraded outline. The model had been told it could request a range but repeated the same request. This combines model behavior with hard-coded suppression and context-output policy; a blanket “same arguments means no useful work” rule is not a reliable substitute for current tool state and retained context.
The separate background-observation deadline misreport and general interruption recovery are tracked in #1290.
A correctable Work input error becomes a terminal contract violation
In an explicit request to exercise Work, a start_work call contained a single initial task that depended on itself. The Work handler rejected the graph with initial Work task cannot depend on itself before obtaining a database connection or creating Work. The same arguments were nevertheless automatically submitted a second time, with a new call ID, and failed identically. The run then terminated with host-owned Work establishment did not produce a successful start_work receipt after the bounded retry instead of allowing the invalid graph to be corrected. The user had clarified the requested Work operation and the clarification was accepted and applied; the requested Work operations were not completed.
The handler's self-dependency check is correct and must remain. The failure is in the recovery boundary: pending establishment is reconciled only by a successful receipt, and the host's bounded retry reuses the frozen call even after this definite pre-mutation validation error. A provisional provider response is replaced by that same carrier, preventing effective correction. Existing tests cover and enforce this general retry behavior but do not establish that a known invalid graph can be corrected through the actual lifecycle. The recorded call does not by itself prove whether the malformed graph originated in the provider response or host admission; the deterministic replay is established by the runtime logic.
The same recovery rule must not be applied to an ambiguous error after a side effect may have occurred. Preserve operation identity, authorization, and safe reconciliation in that case; do not silently delete dependencies or retry an unknown side effect.
Expected behavior
-
A definite, pre-mutation Work input error is delivered to the model with actionable context and allows a corrected call to proceed. The exact invalid call is not replayed automatically, and the run is not terminated merely because it lacks a success receipt. Keep the existing canonical graph validation and avoid introducing a second validation or lifecycle owner. Ambiguous post-mutation outcomes still require safe reconciliation.
-
An explicit Work-control operation resolves the existing authorized conversation binding at the correct boundary. An unrelated follow-up is not silently forced into an old Work.
-
The model receives accurate, usable Work context and capabilities. Preserve real provider and graph-revision checks; distinguish an invalid identity from a genuinely stale revision.
-
Actual execution and Work task attribution agree. When existing work completes outside a currently bound attempt, reconcile using trustworthy evidence rather than requiring the user to ask or allowing unverified success to be fabricated.
-
Clearly distinguish an executing task, an open or retained Work, and delivery/acceptance status. Completed history should not appear as background execution.
-
Choose Work and approval workflows in proportion to the actual user request. Respect already-provided authorization and keep internal bookkeeping out of normal user interaction.
-
Use existing Work change events as the primary update mechanism where available, with bounded, appropriate reconciliation for missed events, reconnects, and concurrent changes. Avoid fixed high-frequency database-backed polling per active viewer.
-
Do not suppress a valid tool operation solely because the same arguments were previously used; account for the actual provider round, changes to the underlying resource, and whether useful output is still available. Keep useful safeguards and explicit error reporting.
Validation
-
Through the real Work admission and tool-execution path, submit a self-dependent initial task, observe a single actionable rejection with no Work created by that attempt, and correct the graph in a later model turn. Verify the corrected Work can start and the requested task can continue. Separately exercise an ambiguous post-mutation error so the correction path cannot duplicate side effects.
-
Exercise a bound Work across a new turn, explicit continuation, unrelated follow-up, executor recreation, and missing/archived binding. Assert both the selected target and the tool outcome.
-
Exercise stale tool selection, genuinely changed authority, invalid context ID, and a concurrent graph revision. Do not weaken identity or mutation preconditions.
-
Exercise externally completed work, interrupted or unknown side effects, and subsequent reconciliation; verify that displayed task and Work status matches available evidence.
-
Test observation delivery, missed events, reconnects, and multiple viewers. Measure HTTP and database request rates for 1,000 concurrent observers and ensure steady-state load is not driven by a fixed two-second full-graph poll per viewer.
-
Cover repeated tool calls across provider rounds, relevant resource changes, and compaction or truncated prior output. Include both useful retries and genuine repeated no-progress calls.
-
Validate that already-authorized, bounded requests are not diverted into an unnecessary hash-based approval workflow, while preserving actual policy and sandbox boundaries.
Design constraints
- Prefer one canonical Work lifecycle and the existing task graph, execution, event, and capability owners. Remove redundant paths rather than introducing another state machine, duplicate store, compatibility layer, or additional SQL hot path.
- Keep ordinary conversation lightweight and give the model accurate messages, usable controls, and freedom to act. Do not build task-specific rules around individual tool names or incident details.
- Preserve authentication, execution authority, sandbox boundaries, optimistic concurrency, and protection against replaying unconfirmed side effects.
- Related: [Bug]: Unreliable agent execution context, tool outcomes, and recovery #1290, [Bug]: Make delegated tool and background task outcomes reliable and actionable #1261, Fix misleading provider errors, interrupted runs, and unreliable agent tools #1286.
Activity
XuPeng-SH commentedon Nov 15, 2026
已合并追踪至 #1302 的第 7 节。stale descriptor、原授权工作流、未确认副作用与实际负载验收仍需完成。
此关闭仅表示将追踪入口合并,不表示原问题已全部修复。原报告、讨论和尚未满足的验收条件继续作为新 issue 的证据与验收来源。