Skip to content

refactor(agent-service): remove dead checkout/headChange path#5930

Draft
bobbai00 wants to merge 1 commit into
apache:mainfrom
bobbai00:refactor/agent-service-remove-checkout
Draft

refactor(agent-service): remove dead checkout/headChange path#5930
bobbai00 wants to merge 1 commit into
apache:mainfrom
bobbai00:refactor/agent-service-remove-checkout

Conversation

@bobbai00

@bobbai00 bobbai00 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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/checkout endpoint and its headChange WebSocket broadcast were never triggered. Removing the dead vertical slice:

  • agent-service/src/server.ts — drop the POST /:id/checkout route and the headChange / workflowContent members of the outgoing WebSocket-message type.
  • agent-service/src/agent/texera-agent.ts — drop TexeraAgent.checkout().
  • frontend/.../agent/agent.service.ts — drop the case "headChange" WS handler and the unused checkoutStep() method.

HEAD tracking is retained: init/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.

This branches from main and is independent of the type-refactor stack (#5751#5928/#5927). Note #5751 currently lists headChange as 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 --noEmit clean, 93/93 bun test pass, prettier clean. Frontend: the removed checkoutStep() had zero callers and the headChange handler is now unreachable; verified no remaining checkout/headChange references and no orphaned imports.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.8 (1M context)

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 `headChange` WebSocket broadcast were
never triggered. Remove the dead vertical slice:

- server.ts: drop the `POST /:id/checkout` route and the `headChange` /
  `workflowContent` members of the outgoing-message type.
- texera-agent.ts: drop `TexeraAgent.checkout()`.
- agent.service.ts (frontend): drop the `case "headChange"` handler and
  `checkoutStep()`.

HEAD tracking itself is retained — `init`/`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
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI agent-service labels Jun 24, 2026
@codecov-commenter

codecov-commenter commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.65%. Comparing base (1c580e5) to head (b7fc2c2).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5930      +/-   ##
============================================
+ Coverage     54.60%   54.65%   +0.05%     
  Complexity     2927     2927              
============================================
  Files          1109     1109              
  Lines         42828    42783      -45     
  Branches       4608     4603       -5     
============================================
- Hits          23385    23383       -2     
+ Misses        18081    18038      -43     
  Partials       1362     1362              
Flag Coverage Δ *Carryforward flag
access-control-service 70.44% <ø> (ø) Carriedforward from 1c580e5
agent-service 34.62% <ø> (+0.26%) ⬆️
amber 56.73% <ø> (ø) Carriedforward from 1c580e5
computing-unit-managing-service 1.65% <ø> (ø) Carriedforward from 1c580e5
config-service 57.35% <ø> (ø) Carriedforward from 1c580e5
file-service 58.59% <ø> (ø) Carriedforward from 1c580e5
frontend 48.35% <ø> (+0.04%) ⬆️
pyamber 90.20% <ø> (ø) Carriedforward from 1c580e5
python 90.76% <ø> (ø) Carriedforward from 1c580e5
workflow-compiling-service 58.69% <ø> (ø) Carriedforward from 1c580e5

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(agent-service): remove the dead checkout/headChange path

2 participants