Skip to content

Add end-to-end tests for a full agent run including tool calls #73

Description

@neooriginal

This issue is AI generated.

Problem

test/e2e/ covers only register_login_logout.test.js and qr_login.test.js. No end-to-end test simulates a full agent run: submitting a task via WebSocket, the engine selecting and executing tools, and completing with a final response. This means regressions in the engine loop, tool runner, or result streaming are only caught by unit tests that mock at a much lower level — or by manual testing.

Evidence

  • test/e2e/ — two test files, neither covers agent runs.
  • No test in any suite submits a real task via agent:run and waits for a run:complete event.

Required change

Add an e2e test that:

  1. Registers/logs in a test user.
  2. Connects a Socket.IO client.
  3. Emits agent:run with a simple deterministic task (e.g. "what is 2+2" with a mock or real model).
  4. Waits for run:complete and asserts the result structure.
  5. Verifies tool events appeared in the correct order.

Add a second test that exercises the tool approval gate: a task that requires an approval, where the test client automatically approves via the REST API, and asserts the run completes.

Acceptance criteria

  • At least one e2e test covers a full agent run from WebSocket submission to completion.
  • At least one e2e test covers the tool approval handshake.
  • Tests are deterministic (use a fixed simple task or a stubbed model response).
  • Tests are included in npm run test:e2e.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomousGenerated by AIenhancementNew feature or requestpriority: mediumAddress in upcoming sprint — functional bug or important enhancementreliabilityReliability, resilience, or concurrency concerntestingTest coverage or test infrastructure work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions