Repository navigation
Commit 479a571
fix(test/worker): assert on envelope-wrapped result shape (#7154)
worker_node was refactored to wrap task results in a {status, message,
data} envelope. Two tests asserted on the unwrapped shape:
test_llm_chat_completion_success — expected `result["response"]`
test_kb_search_success — expected `result["results"]`
With the Redis mock now actually applied (post-#6987 src.* fix), these
failures became visible. They had been silently passing on
stale-mock-luck during the entire src.* bug window.
Fix: update both tests to drill through `result["data"]` to the
canonical position. Add inline reference to #7154 explaining the shape.
Audit (per AC): traced execute_task → task_executor.execute → handlers.
Envelope is applied PER-HANDLER (consistent for task results). The
unwrapped helper-method returns at worker_node.py:104 / 206 / 215 etc.
are internal helpers, not user-facing task results — no drift surface
to file as a follow-up.
Acceptance criteria met:
- ✅ Both tests updated to assert on `result["data"]["response"]` /
`result["data"]["results"]` — verified by 2/2 pass
- ✅ Envelope-pattern audit complete: handlers wrap consistently;
helper-method returns are internal-only
Closes #7154
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 282a420 commit 479a571
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | | - | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| |||
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| 143 | + | |
140 | 144 | | |
141 | | - | |
| 145 | + | |
| 146 | + | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| |||
0 commit comments