Skip to content

fix(server): the machine profile never stores its session answer, and words a move back whose reply is malformed - #3994

Merged
devswha merged 1 commit into
mainfrom
fix/machine-profile-followups
Nov 16, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/machine-profile-followups

Conversation

@devswha

@devswha devswha commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Change

Refs #3982.

Two follow-ups to #3982, on the machine profile (a preview behind OVIS_PREVIEW=fleet). Both were rated low in
that pull request's review and left out of it.

  • GET /api/session now takes its headers from wordedHeaders(), the one source the profile's other worded answers
    already use. On the profile its 200 is cache-control: no-store, as GET /api/machines already was for the same
    snapshot (the snapshot's restore_error is in the profile's own sentence). An ordinary server sends no
    cache-control there, as before.
  • A pane move can take the pane out of its tab and then get a reply to the next move that is no answer at all (a
    malformed reply). That failure is marked as a failed call, as a refused move is, and the profile answers it as it
    answers a pane left in a tab of its own: pane_not_moved, its outcome sentence, no-store. An ordinary server
    answers as before.

server/machine-profile.contract.test.ts gains the malformed-reply move (its answer on the profile is the same as
for a refused move back, no-store) and asserts cache-control on /api/session in the restore case, on the
profile and on an ordinary server.

Validation

  • Red first: the two changed cases against main's server/dispatch.ts and server/herdr/client.ts (bun test ./server/machine-profile.contract.test.ts -t "answers a pane move herdr did not make|tells a pane herdr could not restore"): 0 pass, 2 fail, each on the missing no-store.
  • server/machine-profile.contract.test.ts and server/herdr/client.test.ts, whole, on an isolated herdr test
    session (HERDR_TEST_MODE=integration): 119 pass, 0 fail, 1 skip (a Windows-only case).
  • server/dispatch.test.ts: 14 pass, 0 fail.
  • bun run typecheck: pass.
  • bun run check fast: pass (unit: 17890 pass, 0 fail, 54 skip).
  • Not run: macOS and Windows; the profile is refused on Windows.

… words a move back whose reply is malformed

Two follow-ups to #3982, on the machine profile (a preview behind OVIS_PREVIEW=fleet):

- GET /api/session takes its cache-control from wordedHeaders(), the one source the profile's other worded answers
  use: on the profile its 200 is no-store, as GET /api/machines already was; an ordinary server sends no
  cache-control there, as before.
- A pane move whose move back gets a reply that is no answer (a malformed reply) is marked as a failed call, as a
  refused one is. The profile answers it with the outcome sentence it gives a stranded pane, never stored. An
  ordinary server answers as before.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Corrected how malformed pane-move results are reported, bringing machine-profile responses in line with ordinary-server responses.
    • Updated session responses to use consistent error wording.
    • Machine-profile restore-error responses now prevent caching.

The changes mark converted pane-move errors as failed calls and add worded headers to the /api/session response. Contract tests cover malformed Herdr replies and cache-control headers across profile and ordinary-server responses.

Changes: Machine-profile failure responses

Layer / File(s) Summary
Malformed pane-move failure handling
server/herdr/client.ts, server/machine-profile.contract.test.ts
Converted non-HerdrError values are marked as failed calls. The contract test adds a malformed Herdr reply case and compares the responses across server modes.
Session response failure headers
server/dispatch.ts, server/machine-profile.contract.test.ts
The /api/session response adds headers from wordedHeaders(). The restore-error test checks that profile responses use no-store and ordinary-server responses have no cache-control header.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • devswha/ovis#3982: This is the parent change. Both PRs update the machine-profile Herdr failure response path.
Merge Risk: Minimal · up to ce3dd

This change makes the machine-profile preview treat a malformed pane-move reply as a failed call and send no-store on the session response. Ordinary-server behavior is reported unchanged. No merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two changes: the machine profile not storing its session answer, and a move-back with a malformed reply being worded. It is specific and matches the summarized changes in dispatch.…
Description check Passed The description follows the repository template with its Change and Validation sections. The Change section explains the two follow-ups to #3982, the new cache-control behavior, and the malformed-repl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two changes: the machine profile not storing its session answer, and a move-back with a malformed reply being worded. It is specific and matches the summarized changes in dispatch.ts, herdr/client.ts, and the contract tests. It is long (112 characters) but still conveys the main change, so it passes.

Full details: Description check

Explanation

The description follows the repository template with its Change and Validation sections. The Change section explains the two follow-ups to #3982, the new cache-control behavior, and the malformed-reply handling. It references #3982 as the parent issue, so no separate linked issue is needed. The Validation section lists the commands run, their results, and what was not run (macOS and Windows). It also states the contract-test coverage for the HTTP change, as the template requires.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b0b5f3c and ce3ddb5.

Files selected for processing: 3

  • server/dispatch.ts
  • server/herdr/client.ts
  • server/machine-profile.contract.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@devswha
devswha merged commit 664b89e into main Nov 16, 2026
24 checks passed
@devswha

devswha commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head ce3ddb5bd04d as 664b89eb31ad on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

@devswha
devswha deleted the fix/machine-profile-followups branch November 16, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant