Skip to content

discovery(test/worker): 2 tests assert on unwrapped shape but worker_node returns {status,message,data} envelope #7154

Closed

Description

@mrveiss

Discovery during PR (#6987 part 2)

PR fixing the src.* mock path in worker_node_test.py (#6987 part 2) surfaces 2 pre-existing test failures unrelated to the src.* bug.

Failing tests

FAILED test_llm_chat_completion_success
  assert 'response' in result
  AssertionError: 'response' in {'status': 'success', 'message': 'LLM completion successful.',
                                  'data': {'response': 'Test response'}}

FAILED test_kb_search_success
  assert 'results' in result
  AssertionError: 'results' in {'status': 'success', 'message': 'KB search successful.',
                                 'data': {'results': [{'content': 'test result'}]}}

worker_node was refactored at some point to wrap responses in a {status, message, data} envelope. The tests still assert on the unwrapped shape. With the Redis mock fixed (#6987), these failures are now visible.

Acceptance criteria

  • Update both tests to assert on result["data"]["response"] / result["data"]["results"]
  • Verify the response-envelope pattern is consistent across worker_node — file follow-up if some methods return unwrapped (drift surface)

Related

Activity

  1. github-actions commented on May 8, 2026

    @github-actions
    Contributor

    PR #7230 (merged to Dev_new_gui) references this issue with a close keyword.

    fix(test/worker): assert on envelope-wrapped result shape (#7154)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on May 8, 2026

    @mrveiss
    OwnerAuthor

    ✅ Closed — implementation merged to Dev_new_gui.

    Fix commit: `479a571b5` → squash-merged via PR #7230

    Acceptance Criteria:

    • ✅ Both tests updated to assert on `result["data"]["response"]` / `result["data"]["results"]` — verified at `worker_node_test.py:120-122` and `worker_node_test.py:140-142`. Both pass: `pytest -k 'test_llm_chat_completion_success or test_kb_search_success'` → 2/2 pass.
    • ✅ Envelope-pattern audit complete — traced `execute_task → task_executor.execute → handlers`. Per-handler envelope wrapping is consistent for task results. Unwrapped helper-method returns at `worker_node.py:104, 206, 215, 218, 225, 230, 243` are internal helpers (system queries), not user-facing task results — no drift surface to file as follow-up.

    Wiring verified: N/A — pure test-side change.

    Discovery issues filed: none — envelope is consistent across handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions