Commit 66ff79c
fix(db,chat): translate sslmode→ssl for asyncpg and rebind chat handler request param
* get_async_db_url now rewrites `sslmode=` to `ssl=` in the async DSN.
asyncpg rejects the libpq-style `sslmode` query parameter, which made
DatabaseSessionService.get_session_by_id explode with
"connect() got an unexpected keyword argument 'sslmode'" whenever the
managed Postgres URL required SSL.
* POST /api/v1/chat/{agent_id}/{session_id} was naming its Pydantic body
`request`, shadowing the FastAPI Request used by error_response(). When
the asyncpg crash above fired the generic except, error_response tried
to read `request.url.path` on a ChatRequest model and raised
AttributeError, hiding the real cause.
Renamed the body to `payload` and added an explicit `request: Request`
parameter for error responses.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 17438a3 commit 66ff79c
2 files changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | | - | |
| 628 | + | |
628 | 629 | | |
629 | 630 | | |
| 631 | + | |
630 | 632 | | |
631 | 633 | | |
632 | 634 | | |
| |||
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
640 | | - | |
| 642 | + | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
646 | | - | |
| 648 | + | |
647 | 649 | | |
648 | 650 | | |
649 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | | - | |
| 51 | + | |
47 | 52 | | |
48 | | - | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | | - | |
| 57 | + | |
52 | 58 | | |
53 | | - | |
| 59 | + | |
54 | 60 | | |
55 | | - | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
0 commit comments