feat: add answered user-input conversation items#541
feat: add answered user-input conversation items#541Dimillian merged 3 commits intoDimillian:mainfrom
Conversation
Samigos
commented
Mar 5, 2026
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b164cb22bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/utils/threadItems.ts
Outdated
| ...existing, | ||
| ...item, | ||
| questions: | ||
| incomingHasAnswers || !existingHasAnswers || item.questions.length >= existing.questions.length |
There was a problem hiding this comment.
Preserve existing answers when upserting equal-length user input
The merge condition in upsertItem allows an incoming userInput payload with the same number of questions but no answers to overwrite an existing answered item, because item.questions.length >= existing.questions.length still selects the incoming array. If the same request is submitted twice or resolves out of order (one answered, one blank), the later blank upsert can erase already-recorded answers from the conversation timeline.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efb9b1bac6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/utils/threadItems.ts
Outdated
| incomingHasAnswers || !existingHasAnswers || item.questions.length > existing.questions.length | ||
| ? item.questions |
There was a problem hiding this comment.
Preserve existing answered questions on partial userInput upserts
This branch replaces the entire questions array whenever the incoming payload has at least one answer, so a partial or stale update (for example, one answered question plus one empty question) will erase answers already stored on other questions for the same item. upsertItem can be called multiple times for the same ID (e.g., duplicate submits or out-of-order retries), so this should merge answers per question instead of wholesale replacement.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |