Commit 8cf7006
feat: allow session_name with session_id to rename sessions (#5056)
## Summary
- MCP agents (everyrow-cc) naturally pass both `session_id` and
`session_name` when resuming sessions — this previously threw a
`ValueError`
- Instead of rejecting it, we now use `session_name` as a rename: the
session is resumed via `session_id`, and renamed to `session_name`
- Adds `PATCH /sessions/{id}` to the public API v0, backed by the
existing `update_session_from_spec()` DB function
## Changes
- **Engine API**: New `PATCH /sessions/{session_id}` endpoint +
`UpdateSession` request model
- **Generated client**: New `update_session_endpoint` module +
`UpdateSession` attrs model
- **SDK `create_session()`**: Fires a PATCH rename when both
`session_id` and `name` are provided
- **MCP models**: Removed `_check_session_exclusivity` and all 4 call
sites; updated 8 field descriptions
- **MCP instructions**: Updated "Session and artifact reuse" section to
document rename behavior
- **Tests**: Converted 5 rejection tests → acceptance/rename
verification tests
## Test plan
- [x] `pytest tests/test_session.py` — 17 passed
- [x] `pytest futuresearch-mcp/tests/test_server.py -k session` — 24
passed
- [x] Full SDK suite — 40 passed
- [x] Full MCP suite — 356 passed
- [x] Pre-commit hooks (format, lint, typecheck) — all passed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sourced from commit 9f76f1f3886fea1766b58d9e23c32bb4ab936a731 parent 1551ad3 commit 8cf7006
File tree
8 files changed
+337
-85
lines changed- futuresearch-mcp
- src/futuresearch_mcp
- tests
- src/futuresearch
- generated
- api/sessions
- models
- tests
8 files changed
+337
-85
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 137 | | |
150 | 138 | | |
151 | 139 | | |
| |||
159 | 147 | | |
160 | 148 | | |
161 | 149 | | |
162 | | - | |
| 150 | + | |
163 | 151 | | |
164 | 152 | | |
165 | 153 | | |
166 | | - | |
| 154 | + | |
167 | 155 | | |
168 | 156 | | |
169 | 157 | | |
| |||
202 | 190 | | |
203 | 191 | | |
204 | 192 | | |
205 | | - | |
206 | 193 | | |
207 | 194 | | |
208 | 195 | | |
| |||
377 | 364 | | |
378 | 365 | | |
379 | 366 | | |
380 | | - | |
| 367 | + | |
381 | 368 | | |
382 | 369 | | |
383 | 370 | | |
384 | | - | |
| 371 | + | |
385 | 372 | | |
386 | 373 | | |
387 | 374 | | |
| |||
425 | 412 | | |
426 | 413 | | |
427 | 414 | | |
428 | | - | |
429 | 415 | | |
430 | 416 | | |
431 | 417 | | |
| |||
524 | 510 | | |
525 | 511 | | |
526 | 512 | | |
527 | | - | |
| 513 | + | |
528 | 514 | | |
529 | 515 | | |
530 | 516 | | |
531 | | - | |
| 517 | + | |
532 | 518 | | |
533 | 519 | | |
534 | 520 | | |
| |||
553 | 539 | | |
554 | 540 | | |
555 | 541 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | 542 | | |
562 | 543 | | |
563 | 544 | | |
| |||
604 | 585 | | |
605 | 586 | | |
606 | 587 | | |
607 | | - | |
| 588 | + | |
608 | 589 | | |
609 | 590 | | |
610 | 591 | | |
611 | | - | |
| 592 | + | |
612 | 593 | | |
613 | 594 | | |
614 | 595 | | |
| |||
623 | 604 | | |
624 | 605 | | |
625 | 606 | | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | 607 | | |
632 | 608 | | |
633 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
1646 | 1648 | | |
1647 | 1649 | | |
1648 | 1650 | | |
| |||
1661 | 1663 | | |
1662 | 1664 | | |
1663 | 1665 | | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
1673 | 1677 | | |
1674 | 1678 | | |
1675 | 1679 | | |
| |||
1692 | 1696 | | |
1693 | 1697 | | |
1694 | 1698 | | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
1702 | 1708 | | |
1703 | 1709 | | |
1704 | 1710 | | |
1705 | 1711 | | |
1706 | 1712 | | |
1707 | 1713 | | |
1708 | 1714 | | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
1716 | 1724 | | |
1717 | 1725 | | |
1718 | 1726 | | |
| |||
0 commit comments