test(core): cover handle_message slash commands and agent dispatch - #51
Closed
cursor[bot] wants to merge 4 commits into
Closed
test(core): cover handle_message slash commands and agent dispatch#51cursor[bot] wants to merge 4 commits into
cursor[bot] wants to merge 4 commits into
Conversation
Assert undersized caller buffers get a clear error after snapshot priming, and openai_compat serializes assistant tool_calls plus tool results.
test: cover get_context buffer guard and OpenAI tool-call JSON
Cover on_hup, stale_enqueue, and stale_free_all in reload.c which participates in the 80% coverage gate but lacked dedicated tests.
Add unit tests for /reset, /status, provider forwarding, null text, and agent-failure fallback messaging — the central channel entry point previously had zero coverage on main.
Collaborator
|
Duplicate: development already has dispatch coverage in 25b6327 (test_dispatch.c + bootstrap_dispatch_stub.c). Closing in favor of existing integration. |
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.
Risky behavior now covered
handle_message(src/core/dispatch.c): central channel entry for/reset,/status, and agent forwarding — previously had zero unit coverage onmain(excluded from the coverage gate).agent_runfails with an empty response buffer, users getError: agent failed (code …)instead of a silent empty reply.Test files added/updated
tests/test_dispatch.c—/resetclears session,/statusreturns version, provider success/failure, NULL texttests/stubs/bootstrap_dispatch_stub.c— minimal bootstrap surface so dispatch can be tested without full subsystem initMakefile—test_dispatchtarget wired intomake testand coverage buildsWhy these tests materially reduce regression risk
dispatch.cis the user-facing message router for every channel. Regressions in slash commands or agent wiring would reach production without a crash and without failing the coverage gate. These tests prove the happy path and the failure messaging path with a mock channel + spy/fail providers.Validation
make GATEWAY=0 test_dispatch && ./build/test_dispatchPassed locally (
test_dispatch: all tests passed).