Skip to content

test(server): pin what the tasks and agents route tests let through - #1698

Merged
devswha merged 1 commit into
mainfrom
test/route-mutation-gaps
Oct 23, 2026
Merged

devswha merged 1 commit into
mainfrom
test/route-mutation-gaps

Conversation

@devswha

@devswha devswha commented Oct 23, 2026

Copy link
Copy Markdown
Owner

A test-only follow-up to the background tasks slice (#1688) and the agent catalog slice (#1690). In their code reviews, the reviewer broke the moved routes on purpose, one change at a time, to see whether the route tests would notice. Three of those breakages left every test passing. This PR adds what those three cases need. No production file changes.

server/tasks-routes.test.ts (#1688 review, point 3)

The test that calls the route directly with an OmO session now also:

  • writes a dag_1.json workflow record for that session under the project's .omo/senpi-task/dag/runs, and asserts runs is [["dag_1", "Bug-fix round", "running"]] (id, name, status). Before, the fixture had no workflow, so runs was [] either way, and returning runs: [] from the OmO branch went unnoticed;
  • asserts server_time on the OmO answer parses as a date. Before, it was checked only on the non-OmO answer, so dropping it from the OmO branch went unnoticed.

server/agents-routes.test.ts (#1690 review, L1 and the surviving sort mutation)

  • Sort order: the stubbed herdr manifests now also offer cmd (label "Command Code") and copilot (label "GitHub Copilot"). Sorted by label, they land after codex and after gjc; sorted by kind, cmd comes before codex and copilot before gjc. Sorting by kind instead of label now fails the test.
  • Error mapping: a plain error from herdr's agent manifests now pins 500 internal_error without the error's own text, next to the existing HerdrError → 502 case.

Checks

  • HERDR_TEST_MODE=unit bun test server/tasks-routes.test.ts server/agents-routes.test.ts: 6 pass, 0 fail.

  • The three breakages from the reviews each fail a test now. I made each change, ran the two test files, then restored the code:

    Breakage Before this PR Now
    OmO branch answers runs: [] all tests pass 1 fail
    OmO branch answers without server_time all tests pass 1 fail
    /api/agents sorted by kind only all tests pass 1 fail
  • bun run typecheck: passes.

  • bun run check fast: passes (unit 6161 pass, 0 fail, 12 skip in 440 files, 8 at a time, 57.5s).

Test-only: no change in server/ outside the two test files, nor in src/ or shared/. No changelog fragment: users see no change.

Code review of the background tasks and agent catalog slices found three
mutations their route tests did not catch. The OmO case now writes a dag_*.json
workflow record and checks runs and server_time on the OmO answer, so answering
runs: [] or dropping server_time fails. The agent list now includes kinds whose
label order differs from their kind order (cmd, copilot), so sorting by kind
fails, and a plain error from herdr pins 500 internal_error beside the 502.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between cee5216 and 3f69917.

📒 Files selected for processing: 2
  • server/agents-routes.test.ts
  • server/tasks-routes.test.ts
  • 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

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Merging without a CodeRabbit review: CodeRabbit hit its review limit on this PR ("Review limit reached"), so no review ran. This is a test-only change (two test files, no production code), so I did not ask for another one (AGENTS.md).

The merge pass reviewed it instead, at head 3f69917:

  • the diff changes only server/agents-routes.test.ts and server/tasks-routes.test.ts, it is built on current main, and no other open PR touches either file;
  • in a scratch checkout, HERDR_TEST_MODE=unit bun test server/tasks-routes.test.ts server/agents-routes.test.ts gives 6 pass, 0 fail;
  • with /api/agents sorted by kind only (server/agents-routes.ts:48), the agents test fails (1 pass, 1 fail), as the PR says it should;
  • all required checks are green.

@devswha
devswha merged commit 50041fd into main Oct 23, 2026
17 checks passed
@devswha
devswha deleted the test/route-mutation-gaps branch October 23, 2026 03:11
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