Skip to content

Add reasoningMode and getChatById to DuckAiChat Store#8659

Merged
YoussefKeyrouz merged 1 commit into
developfrom
feature/youssef/per_chat_model_reasoning
May 21, 2026
Merged

Add reasoningMode and getChatById to DuckAiChat Store#8659
YoussefKeyrouz merged 1 commit into
developfrom
feature/youssef/per_chat_model_reasoning

Conversation

@YoussefKeyrouz
Copy link
Copy Markdown
Collaborator

@YoussefKeyrouz YoussefKeyrouz commented May 21, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212810093780571/task/1215002056518125?focus=true

Description

Per-chat reasoning persistence groundwork (1 of 3).

The FE has been storing a reasoningMode field per chat in the JSON blob it pushes to native storage, but Android wasn't reading it. This PR starts extracting that field on the read side so it's available to consumers, and adds a single-chat lookup API to the store. No behavioural change yet - the new field isn't consumed by any feature in this PR.

The follow-up PR will use this data to populate the reasoning picker correctly when the user opens an existing chat (showing the chat's stored mode rather than the global default).

What changed:

  • DuckAiChat Added a nullable reasoningMode: String? field.
  • **New API: getChatById** on DuckAiChatStore. Wraps the existing chatsDao.getById(chatId)`.

No migration required. Room only stores (chatId, data) where data is the raw FE blob, we just parse a new field at read time.

Steps to test this PR

  • Submit a duck.ai chat after selecting a model and reasoning effort (e.g. gpt 5 mini - fast)
  • Go to Settings -> Duck.ai in developer settings -> Enable Native Storage Debug
  • Validate that the chat is now stored with the selected “reasoningMode"

UI changes

N/A — data-layer only.


Note

Low Risk
Low risk data-layer change that only extends the parsed chat metadata and adds a read-only lookup API; main risk is minor integration/consumer expectations around null/empty reasoningMode handling.

Overview
Adds per-chat reasoningMode: String? to DuckAiChat and updates JSON parsing to populate it while treating missing, empty, or explicit JSON null as null.

Extends DuckAiChatStore with getChatById(chatId) (implemented in RealDuckAiChatStore) to fetch and parse a single chat, and adds unit tests covering reasoningMode parsing and the new lookup behavior (not found / malformed JSON).

Reviewed by Cursor Bugbot for commit a380f28. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Collaborator Author

YoussefKeyrouz commented May 21, 2026

@YoussefKeyrouz YoussefKeyrouz marked this pull request as ready for review May 21, 2026 17:39
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 7738d8f. Configure here.

@YoussefKeyrouz YoussefKeyrouz force-pushed the feature/youssef/per_chat_model_reasoning branch from 7738d8f to e4ba144 Compare May 21, 2026 17:54
Base automatically changed from feature/youssef/ai_reasoning_effort_upsell to develop May 21, 2026 20:37
@YoussefKeyrouz YoussefKeyrouz force-pushed the feature/youssef/per_chat_model_reasoning branch from e4ba144 to a380f28 Compare May 21, 2026 20:55
Copy link
Copy Markdown
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@YoussefKeyrouz YoussefKeyrouz merged commit ee6931c into develop May 21, 2026
15 checks passed
@YoussefKeyrouz YoussefKeyrouz deleted the feature/youssef/per_chat_model_reasoning branch May 21, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants