Commit 6f3fe08
committed
fix(mcp): return empty working memory instead of none for missing sessions
the mcp get_working_memory handler imported the fastapi route handler
from api.py which has a starlette Header() default parameter for
x_client_version. when called from mcp (not http), the Header object
is passed as-is to re.match() causing "expected string or bytes-like
object, got 'Header'".
fix: call working_memory.get_working_memory (the core function)
directly instead of the api route handler, and guard the None return
with an empty WorkingMemory.1 parent 2ea6ca4 commit 6f3fe08
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
361 | 362 | | |
362 | 363 | | |
363 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| |||
910 | 911 | | |
911 | 912 | | |
912 | 913 | | |
913 | | - | |
| 914 | + | |
914 | 915 | | |
915 | 916 | | |
916 | 917 | | |
| |||
0 commit comments