Skip to content

test(acp): pull advertised-commands list from source of truth#18977

Open
Sanjays2402 wants to merge 1 commit into
NousResearch:mainfrom
Sanjays2402:fix/main-ci-acp-commands-ordering
Open

test(acp): pull advertised-commands list from source of truth#18977
Sanjays2402 wants to merge 1 commit into
NousResearch:mainfrom
Sanjays2402:fix/main-ci-acp-commands-ordering

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Summary

Fixes one Tests failure observed on main (and therefore propagating to every open PR):

FAILED tests/acp/test_server.py::TestSessionOps::test_send_available_commands_update
  AssertionError: assert ['help', 'mod...compact', ...] == ['help', 'mod...compact', ...]

Reference run: 25250051126 on 5d3be898a.

Root cause

HermesACPAgent._ADVERTISED_COMMANDS was extended with steer and queue (between compact and version), but the test still hardcoded the old 7-name list:

assert [cmd.name for cmd in update.available_commands] == [
    "help", "model", "tools", "context", "reset", "compact", "version",
]

…so any update that added a command failed the assertion even though the agent was behaving correctly.

Fix

Pull the expected name list from HermesACPAgent._ADVERTISED_COMMANDS directly:

expected_names = [spec["name"] for spec in HermesACPAgent._ADVERTISED_COMMANDS]
assert [cmd.name for cmd in update.available_commands] == expected_names

The behavioural assertions the test actually cares about (session_update is awaited once with the right session id, returns an AvailableCommandsUpdate, model's input hint is intact) are preserved.

Validation

$ pytest tests/acp/test_server.py::TestSessionOps::test_send_available_commands_update -q
1 passed in 1.34s

Scope

  • ✅ No production code change (test-only fix)
  • ✅ Behavioural assertions intact
  • ✅ Future command additions/reorders no longer require touching this test

Out of scope

The other ~12 main-CI failures — happy to send those as separate focused PRs (#18972, #18974 already up).

`HermesACPAgent._ADVERTISED_COMMANDS` was extended with `steer` and
`queue` (between `compact` and `version`), but
`test_send_available_commands_update` still hardcoded the old 7-name
list, so it failed:

    AssertionError: assert ['help', 'mod...compact', ...] == ['help', 'mod...compact', ...]

Read the expected name list from
`HermesACPAgent._ADVERTISED_COMMANDS` directly so the assertion
follows the registered command set rather than drifting whenever
commands are added.

The behavioural assertion (`session_update` is awaited once with the
right session id, returns an `AvailableCommandsUpdate`, and
`model`'s input hint is intact) is preserved.

No production code change. Fixes the failure observed on `main`
(run 25250051126):

`tests/acp/test_server.py::TestSessionOps::test_send_available_commands_update`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants