AGE-1957: Pass create_turn turn through without any fallback. - #17
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe synchronous and asynchronous API adoption paths now pass the returned ChangesTurn adoption
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This is a localized SDK behavior change, and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| self._session, | ||
| self._client, | ||
| ) | ||
| self._turn = Turn(turn, self._session, self._client) |
There was a problem hiding this comment.
same comment as TS, do we need to copy turn if Turn mutates it in anyway?
same for self._session
--
same comment for async
There was a problem hiding this comment.
same comment as TS, do we need to copy turn if Turn mutates it in anyway?
same for self._session
-
Turn (
src/truefoundry_gateway_sdk/agents/turn.py) only reads fields onto self, later updates reassign self._state, never the passed-in turn -
Session (AgentSession / AgentDraftSession): constructor copies fields from the raw session; does not write back. Draft update() only reassigns private fields from the new response
same comment for async
AsyncTurn / AsyncAgentSession / AsyncAgentDraftSession mirror the sync constructors and only reassign private fields from new responses.
AGE-1957: Pass create_turn turn through without any fallback.
Note
Low Risk
Small SDK behavior change: turn
inputafter JSONcreate_turnnow reflects the API response only, which may differ from prior local fallback when the server leavesinputempty.Overview
PreparedTurnandAsyncPreparedTurnnow adopt thecreate_turn/get_turnpayload as-is when using the non-streaming path (execute(stream=False))._adopt_turn_from_apino longer rebuilds aRawTurnor substitutes stagedself._inputwhen the API omitsinput; it wraps the returnedRawTurndirectly inTurn/AsyncTurn. The streamingturn.createdadoption path is unchanged and still builds a turn from the event plus local input.Reviewed by Cursor Bugbot for commit 7c48fff. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit