Repository navigation
feat(workhub): simplify coordination and unify remote task workflows - #6051
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
I found one P2 issue at bf0c3d9aa2a5058ab5460465ddc38b77494913b4.
- P2 — preserve steering's question policy through a physical successor (
packages/runtime-host/src/server/root-turn-coordinator.ts:3269). WorkHub steering changes an already-running ordinary task to return missing information. This continuation loop instead reuses the policy captured before that steering. In the existing physical-handoff integration fixture, the running generation hasquestions: 'return', but its successor receives no question policy. The logical Turn completes normally; the missing policy means subsequentAskUserQuestioncalls can suspend the worker again, with no WorkHub question relay. Refresh the effective execution policy before resuming the same logical Turn. An ordinary later user Turn should still restore ordinary behavior. - P3 — reconcile protocol epoch numbering before integration (
packages/runtime-host/src/protocol/index.ts:107). This PR declares epoch 213 for new coordination/configuration semantics, while the currently open #5394 (2fc0e4c2) and #5969 (c19d60ec) also declare 213 for different changes. Their numbers should not silently identify interchangeable protocol contracts.
The configuration and routing changes otherwise follow the maintainer decisions in #5745: the coordinator chooses operations directly, new tasks inherit its model, reused tasks keep their model, and scoped WorkHub permissions do not overwrite saved target permissions. Remote shared-context routing is explicitly opt-in; question-answer routing checks the original chat and sender. I did not find another P0–P2 issue in these paths.
Validation: seven relevant packages built; Desktop's four typechecks passed; 750 of 751 selected Node tests passed. The remaining ordinary Bash test returned Command sandbox is required but unavailable on platform linux on this machine, so it is not evidence of a WorkHub regression. All 38 focused Chromium Storybook render/play/accessibility scenarios passed. The additional handoff-policy probe failed on this head and passed when the continuation received the updated live policy; that diagnostic mutation was removed. No live remote-provider or native Electron/platform certification is claimed.
The head remained unchanged at the final check. CI run 38045922816 was still running; I am not treating it as green. The P2 should be fixed before merging, and this feature/refactor still requires a human merge decision.
| active.continuation = plan.continuation; | ||
| }); | ||
| stream = this.manager.resumeSafeBoundaryContinuation(active.continuation!, { | ||
| executionPolicy, |
There was a problem hiding this comment.
[P2] Refresh the effective question policy before the physical successor
executionPolicy was captured when this logical Turn started. If WorkHub later steers an ordinary running task, returnExecutionQuestions updates its live policy to questions: 'return', but this loop still passes the old undefined policy. RuntimeKernel consequently creates a successor without the missing-information return policy, and AskUserQuestion can suspend it again after WorkHub's relay was removed. I exercised the production physical-handoff fixture: the live policy was return before sealing, the Turn completed, and the successor context had no question policy. Supplying the updated policy made that same probe pass. Resolve the latest effective policy for the same execution lineage before resuming; do not confuse this physical successor with an ordinary later user Turn.
| // Increment when the same protocol version no longer guarantees safe Client-Host | ||
| // interoperability. Mismatches are rejected before domain commands are admitted. | ||
| export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 212 as const; | ||
| export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 213 as const; |
There was a problem hiding this comment.
[P3] Reconcile this epoch with the other open protocol changes
The current open heads of #5394 (2fc0e4c2) and #5969 (c19d60ec) also declare epoch 213, for different contracts. This PR changes WorkHub coordination/configuration semantics. Coordinate a distinct final epoch at integration so incompatible clients and Hosts do not share the same handshake value.
Use the coordinating agent directly, persist WorkHub model settings, scope delegated permissions to executions, and separate steering from stop and delegation. Preserve historical recovery records and return worker missing information through ordinary follow-up messages. Generated-by: Codex
…ions Preserve delegated permissions across child and graph execution lineage, restore scoped policy from durable Host facts, and update question handling when steering an existing backend. Generated-by: Codex
Use an independent proxy facade so bound methods and permission read overrides do not violate invariants on frozen Host stores. Exercise the production frozen facade shape in the scoped-policy regression test. Generated-by: Codex
Add remote message handling settings, durable source-aware replies, and compact interaction choice answers. Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Result notification turns had no links unless they delegated again. Derive their Host-scoped task identity from the durable result origin so rails and filters also cover tool-free result summaries. Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
…mpletion Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Check WorkHub rails against bubble bounds after the shorter-rail design. Give localized usage timestamps 8px more room so Linux font metrics fit without weakening the overflow assertion. Generated-by: Codex
Resolve the latest durable policy for each physical continuation, including steered ordinary admissions with no sourceMessages. Add production composition coverage proving successor inheritance and restoration on a later user Turn. Use compatibility epoch 214 to distinguish this contract from the open epoch-213 changes. Generated-by: Codex
Provide the shared WorkHub enablement context to the new dock backdrop fixture and refresh the merged UI inventory totals. Generated-by: Codex
bf0c3d9 to
8b15c0a
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
At 8b15c0a9d51af8a34c5155941180d203e3d98181, the previously reported P2 handoff-policy failure is fixed. Each physical successor now resolves the latest durable policy, including WorkHub steering of an ordinary Turn without source messages. The production composition test observes ordinary → return → ordinary across the initial run, its steered successor, and a later user Turn. Reverting only the two policy changes reproduced the missing successor policy; restoring them passed the complete relevant suite.
[P3] Epoch 214 is already used by #5548 (packages/runtime-host/src/protocol/index.ts:107). Moving from 213 avoids #5394/#5969 but creates a different collision: #5548 at dc7a4fdd4b89b4845349b5543c56c2eb81a9b042 also uses 214 for an unrelated contract. Across 188 open PR heads checked, 215 is currently unused. Coordinate allocation and recheck before merging; the two distinct contracts should not advertise interchangeable compatibility.
The rebase preserves the earlier changes; the added Desktop fixture uses the shared WorkHub enablement context and the generated surface inventory totals agree. No additional P0–P2 issue was found in this increment.
Validation: 393 of 394 selected Node tests passed (245/246 Host, 148/148 Desktop/UI); the sole failure is the same ordinary Bash test returning Command sandbox is required but unavailable on platform linux on this machine. All 38 focused Chromium scenarios passed. Seven dependency projects, Desktop main and all four Desktop typechecks passed. No live remote-provider, native Electron or cross-platform certification is claimed.
This exact head's CI test succeeded in run 38048782832. GitHub reports MERGEABLE/BLOCKED; automatic merging with main bacb1caed is textually clean. This comment is not a human merge decision.
| // Increment when the same protocol version no longer guarantees safe Client-Host | ||
| // interoperability. Mismatches are rejected before domain commands are admitted. | ||
| export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 212 as const; | ||
| export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 214 as const; |
There was a problem hiding this comment.
[P3] Allocate a distinct compatibility epoch before integration
Epoch 214 now conflicts with open #5548 at dc7a4fd, which declares 214 for a different wire contract. The move fixes the previous epoch-213 collision but not unique allocation. Main is currently 212 and 215 is currently unused across 188 open heads checked. Coordinate the number and recheck immediately before merging.
Epoch 214 is also declared by open PR apache#5548. Verified all 188 current open PR heads: apache#5394 and apache#5969 use 213, apache#5548 and this PR use 214, and 215 is unused. Move WorkHub to 215; allocation must be rechecked at integration because the base-only CI guard cannot reserve numbers across open branches. Generated-by: Codex
Summary
Refs #5745
wnto show progress and next-step suggestions for the three most recent works, then place the selected prompt draft in the desktop composer without executing it.Verification
wndiscovery, selection, and draft insertion using SQL/CS336 tasks; verified that drafting started no target Session invocation. Checked answered-choice expansion and result identity rails in the app.git diff --checkpassed. Merge check against current upstreammainreports no conflicts.AI use
Tool(s) and scope: OpenAI Codex implemented the refactor, remote routing, and UI changes; added tests; and performed native validation. Retain the Generated-by trailer in the squash commit.
Checklist
Focused typechecks/tests and whitespace validation passed; the full repository lint/format gate was not rerun for this PR.
Does this PR entail a change in behavior?
Generated-by: Codex