Per-chat reasoning effort in contextual sheet#8674
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4d75802 to
7ce9eef
Compare
b60ace4 to
2882db3
Compare
7ce9eef to
7159e2d
Compare
2882db3 to
6f9a5f1
Compare
malmstein
left a comment
There was a problem hiding this comment.
tested locally and confirmed it works as expected.
clean wire-up of contextual into the per-chat reasoning flow. nice that this PR also fixes the fullModeUrl correctness gap on the existing-chat-restore and new-chat-clear paths — easy to miss those were never being assigned before. the ReasoningModePickerViewModel.onModeTapped snapshot of modelState is a small but real win against the chance of a fetchModels emission landing mid-handler.
main note is the fullModeUrl / _chatId pair-assignment drift risk below. separately worth keeping on the radar: PR #8631 (still open) adds Uri.toChatIdOrNull(duckChat) in duckchat-api doing similar parsing — once it lands, both this PR's extractChatId and any other in-flight extractors could converge on the api extension. not blocking either way.
note for outcome tracking: the model-fallback asymmetry I flagged on #8666 (L161, getSelectedModelId vs getResolvedReasoningEffort when chat's model isn't in modelState) isn't touched here — that one's still pending on #8666's side.
| } else { | ||
| withContext(dispatchers.main()) { | ||
| fullModeUrl = existingChatUrl | ||
| _chatId.value = extractChatId(existingChatUrl) |
There was a problem hiding this comment.
nit: fullModeUrl = ...; _chatId.value = extractChatId(...) is now repeated at L190-191, L243-244, and L289+292 (and a clearing pair at L649-650). a future addition that sets a new sheet URL but forgets the chatId update would silently break per-chat resolution. can we wrap this in a private helper like setSheetUrl(url: String?) that owns both fields, plus a clearSheetUrl() for the new-chat path? keeps the invariant in one place.
There was a problem hiding this comment.
Good catch. Addressed.
7159e2d to
9f586f9
Compare
6f9a5f1 to
caae8f5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9f586f9. Configure here.
9f586f9 to
b204f93
Compare


Task/Issue URL: https://app.asana.com/1/137249556945/project/1212810093780571/task/1215062229903137?focus=true
Description
Wires the contextual Duck.ai sheet into the per-chat reasoning flow introduced by #8666 and fixes two correctness bugs
ReasoningModePickerViewModelSteps to test this PR
Per-chat scope restored on reopen
Globals untouched
Note
Medium Risk
Moderate risk: changes how the contextual sheet tracks/propagates the active
chatId, which affects session restore behavior and per-chat model/reasoning selection; regressions could surface as incorrect picker state or chat continuity issues.Overview
Adds a
chatIdstate flow toDuckChatContextualViewModel, derived from the current/stored Duck.ai URL, and keeps it in sync whenever the sheet URL changes or a new chat is started.Wires this
chatIdFlowthroughDuckChatContextualFragmentintoContextualNativeInputManager/NativeInputModeWidgetso native input can participate in per-chat reasoning/model scoping when reopening/restoring contextual chats. Includes a small correctness/cleanup tweak inReasoningModePickerViewModelto use a singlemodelStatesnapshot per tap, plus new unit tests coveringchatIdlifecycle (set on restore/load, unchanged in INPUT mode, cleared on new chat).Reviewed by Cursor Bugbot for commit b204f93. Bugbot is set up for automated code reviews on this repo. Configure here.