refactor(agent-service): remove dead checkout/headChange path#5930
Merged
Yicong-Huang merged 1 commit intoJun 28, 2026
Merged
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5930 +/- ##
============================================
- Coverage 56.28% 56.26% -0.03%
Complexity 2992 2992
============================================
Files 1120 1120
Lines 43217 43175 -42
Branches 4662 4658 -4
============================================
- Hits 24326 24292 -34
+ Misses 17472 17461 -11
- Partials 1419 1422 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
Jun 24, 2026
Convert the per-message comments in types/ws to uniform JSDoc blocks (so they surface in IDE hovers) and give every client and server frame a brief purpose line. Mark WsServerHeadChangeMessage @deprecated: it is redundant and unused (the checkout flow that emits it is unreachable) and is slated for removal in apache#5930. Doc-only; no type or runtime change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qFkyrpTd5PrkNBPcBeo4Q
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
Jun 24, 2026
…lts on demand Operator result summaries were pushed over the socket (on snapshot, step, and completion frames), but the only frontend consumer — the per-operator chat popover — reads them from a subject that was fed solely by those pushes, and the step-frame results were never applied at all (dead payload). Most summary fields are server-side agent context that is never displayed. Move results to an on-demand pull and slim the socket to conversation + lifecycle: - Drop the `completion` frame entirely (type, server broadcast, frontend handler). Run-end is already signaled by the end-of-run `status` frame. - Drop `operatorResults` from the `snapshot` and `step` frames (and stop computing/sending them there). - The chat popover now calls fetchOperatorResults() (GET /operator-results) when it opens, pushing fresh summaries to operatorResultSummaries$. - Remove the dead result-annotations machinery (toggleResultAnnotations, resultAnnotationsVisible(Subject/$), getResultAnnotationsVisible) — no callers. Server frames are now: snapshot, step, status, error (plus the deprecated headChange, removed in apache#5930). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qFkyrpTd5PrkNBPcBeo4Q
This was referenced Jun 24, 2026
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
Jun 28, 2026
Convert the per-message comments in types/ws to uniform JSDoc blocks (so they surface in IDE hovers) and give every client and server frame a brief purpose line. Mark WsServerHeadChangeMessage @deprecated: it is redundant and unused (the checkout flow that emits it is unreachable) and is slated for removal in apache#5930. Doc-only; no type or runtime change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qFkyrpTd5PrkNBPcBeo4Q
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
Jun 28, 2026
…lts on demand Operator result summaries were pushed over the socket (on snapshot, step, and completion frames), but the only frontend consumer — the per-operator chat popover — reads them from a subject that was fed solely by those pushes, and the step-frame results were never applied at all (dead payload). Most summary fields are server-side agent context that is never displayed. Move results to an on-demand pull and slim the socket to conversation + lifecycle: - Drop the `completion` frame entirely (type, server broadcast, frontend handler). Run-end is already signaled by the end-of-run `status` frame. - Drop `operatorResults` from the `snapshot` and `step` frames (and stop computing/sending them there). - The chat popover now calls fetchOperatorResults() (GET /operator-results) when it opens, pushing fresh summaries to operatorResultSummaries$. - Remove the dead result-annotations machinery (toggleResultAnnotations, resultAnnotationsVisible(Subject/$), getResultAnnotationsVisible) — no callers. Server frames are now: snapshot, step, status, error (plus the deprecated headChange, removed in apache#5930). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qFkyrpTd5PrkNBPcBeo4Q
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
Jun 28, 2026
apache#5751) ### What changes were proposed in this PR? This PR refactors the agent-service ↔ frontend WebSocket messaging into a dedicated **`types/ws`** folder. Each frame is a small class whose `type` discriminator equals its class name (matching the main Texera WS convention, e.g. `RegionUpdateEvent`). Building a frame with `new WsServerStatusEvent(...)` sets the wire `type` for you, so no `type: "..."` literal is hand-written at call sites; receivers `switch` on `event.type`. - `types/ws/client.ts` — frames the frontend sends, unioned as `WsClientCommand`: - `WsClientPromptCommand` — a user prompt for the agent to run. - `WsClientStopCommand` — stop the in-flight run (payload-less). - `types/ws/server.ts` — frames agent-service sends back, unioned as `WsServerEvent`: - `WsServerSnapshotEvent` — full state, sent once when a client connects. - `WsServerStepEvent` — one step, streamed live as the agent runs. - `WsServerStatusEvent` — a lifecycle change (GENERATING / AVAILABLE / STOPPING). - `WsServerErrorEvent` — an error to surface to the user. - `WsServerHeadChangeEvent` — unused by the frontend/UI (still reachable via `/agents/:id/checkout`); slated for removal in apache#5930. - Operator result summaries are no longer pushed over WebSocket — they are pulled on demand via `GET /agents/:id/operator-results`. The corresponding REST DTO `OperatorResultSummary` lives in `types/execution.ts` (not under `ws/`). This PR also adds unit tests and renames the `agent-service` test files from `*.test.ts` to `*.spec.ts` to align with the frontend's naming convention. ### Any related issues, documentation, discussions? Closes apache#5749 ### How was this PR tested? Added/updated unit tests in both `agent-service` and `frontend` all pass; a local end-to-end run was also verified. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b7fc2c2 to
1b0d710
Compare
The step-checkout feature was wired end-to-end but unreachable: nothing in the product ever invokes the frontend `checkoutStep()`, so the backend `/agents/:id/checkout` endpoint and its `WsServerHeadChangeEvent` broadcast were never triggered. Remove the dead vertical slice: - types/ws/server.ts: drop the `WsServerHeadChangeEvent` class and its membership in the `WsServerEvent` union (and the now-unused `WorkflowContent` import). - server.ts: drop the `POST /:id/checkout` route, the `WsServerHeadChangeEvent` import, and its mention in the WS usage banner. - texera-agent.ts: drop `TexeraAgent.checkout()`. - server.spec.ts: drop the `checkout route` test block. - agent.service.ts (frontend): drop the `case "WsServerHeadChangeEvent"` handler and `checkoutStep()`. HEAD tracking itself is retained — the snapshot/step messages still carry `headId`, and the chat panel still walks the ancestor path from HEAD to render the visible step chain. Only the backward HEAD move (checkout) is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012qFkyrpTd5PrkNBPcBeo4Q
Yicong-Huang
approved these changes
Jun 28, 2026
Yicong-Huang
left a comment
Contributor
There was a problem hiding this comment.
thanks for clean up. LGTM
1b0d710 to
3b9d332
Compare
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.
What changes were proposed in this PR?
Removes the step-checkout feature from agent-service, which was wired end-to-end but unreachable — nothing in the product ever invokes the frontend
checkoutStep(), so the backend/agents/:id/checkoutendpoint and itsheadChangeWebSocket broadcast were never triggered. Removing the dead vertical slice:agent-service/src/server.ts— drop thePOST /:id/checkoutroute and theheadChange/workflowContentmembers of the outgoing WebSocket-message type.agent-service/src/agent/texera-agent.ts— dropTexeraAgent.checkout().frontend/.../agent/agent.service.ts— drop thecase "headChange"WS handler and the unusedcheckoutStep()method.HEAD tracking is retained:
init/stepmessages still carryheadId, and the chat panel still walks the ancestor path from HEAD to render the visible step chain. Only the backward HEAD move (checkout) is removed.This branches from
mainand is independent of the type-refactor stack (#5751 → #5928/#5927). Note #5751 currently listsheadChangeas a server message; whichever merges second will drop it from the union — a trivial reconciliation.Any related issues, documentation, discussions?
Closes #5942
Part of #5747. Independent of the stack (branches from
main).How was this PR tested?
agent-service:
tsc --noEmitclean, 93/93bun testpass, prettier clean. Frontend: the removedcheckoutStep()had zero callers and theheadChangehandler is now unreachable; verified no remainingcheckout/headChangereferences and no orphaned imports.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8 (1M context)