Repository navigation
fix: group chat reliability batch - #70
Conversation
…for an answered turn Co-authored-by: Cursor <cursoragent@cursor.com>
…TS is set Co-authored-by: Cursor <cursoragent@cursor.com>
…name Co-authored-by: Cursor <cursoragent@cursor.com>
…for another one Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Reflections no longer filter by category in the UI, API, tool schema or evidence scope. The scope key hash keeps a constant empty categories entry so existing keys stay valid. Co-authored-by: Cursor <cursoragent@cursor.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15992f0291
ℹ️ 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".
| WHERE thread_id=? AND role='tool' AND content IN (${ANSWERING_TOOLS.map(() => "?").join(",")}) | ||
| AND json_extract(metadata_json,'$.output.success')=1 | ||
| AND rowid>? AND (? IS NULL OR rowid<?) |
There was a problem hiding this comment.
Preserve confirmations for writes made after staying quiet
On a retry after a successful stay_quiet followed by a successful record write, this query returns true merely because the silence tool exists. That ordering is possible because stay_quiet only rejects writes that occurred before it; a later write succeeds and requires confirmation. If the first attempt then fails during a subsequent completion or while delivering that confirmation, the early return at line 1906 marks the event handled without sending anything, leaving the group unaware that its record changed. Treat stay_quiet as terminal only when no later successful record-write trace exists.
Useful? React with 👍 / 👎.
| // Past the assistant's reply, which may have been two bubbles, to what it answered. | ||
| const answered = earlier.find(row => row.role === "user"); | ||
| AND (? IS NULL OR (created_at<=(SELECT created_at FROM channel_messages WHERE id=?) AND id<>?)) | ||
| ORDER BY created_at DESC,rowid DESC LIMIT 12 |
There was a problem hiding this comment.
Search the full follow-up window for the asked question
In a named_only group, once 12 other eligible messages arrive after the assistant's question, this fixed limit excludes the assistant row even when it is still inside the documented ten-minute follow-up window. When the originally addressed person then answers without naming the assistant, answersAssistant() returns false, so holdUntilNamed() silently holds the answer and runs no completion. Locate the latest assistant message within the time window rather than limiting the search to 12 total rows.
Useful? React with 👍 / 👎.
| // The reply may have been two bubbles; what it asked can be in either. | ||
| let firstBubble = lastSaid; | ||
| while (earlier[firstBubble + 1]?.role === "assistant") firstBubble += 1; | ||
| const asked = earlier.slice(lastSaid, firstBubble + 1).some(row => /\?\s*$/.test(row.content.trim())); |
There was a problem hiding this comment.
Recognize questions that have trailing text
A question is recognized only when the entire assistant bubble ends in ?. Natural replies such as Which song? I can look it up. or Which one? 🎵 therefore set asked to false; in named_only mode, even an immediate answer from the person the assistant addressed is then held without a completion. Detect a question independently of trailing prose or emoji so the new follow-up exception applies to these messages.
Useful? React with 👍 / 👎.
…w notes - Folding a backlog of group texts (older than two minutes when reached) stays on while GROUP_BURSTS is off, so an outage does not cost a turn each. - A post to another group counts as an answer when a failed turn is retried. - Pages made through POST /api/pages are offered related pictures too. - answersAssistant keeps its indexed range scan when the inbound is filed. Co-authored-by: Cursor <cursoragent@cursor.com>
… tidy review notes - answersAssistant reads the thread over the follow-up window, keeps a question open until its person speaks, and takes a kind instead of a flag. - turnAlreadyAnswered also counts a bubble the turn filed itself; a retry of an overtaken turn no longer ends its window on a reply. - todayIs and todayWeekday replace six copies of the date line and the weekday lookup; a GIF title naming today as well is kept. - related_pictures carries the planned shape only. - Tests for the empty-response early end, the give-up suppression, and the open question; docs and the prompt match. Co-authored-by: Cursor <cursoragent@cursor.com>
…d read any question mark - A retry is not skipped, and the give-up line is not withheld, when a record was written beside the GIF, post, or silence: its confirmation was never sent. - A bubble asks a question wherever its question mark falls, outside links. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
GROUP_BURSTS=1turns them back on), so each group text is its own turn and reactions land on the right message.find_gifdrops results titled for a different weekday.create_pagein a group returns scopedrelated_picturesfrom the group's own memories; prompt tells the agent to add them.Deploy notes
Republish
agent-studio/system-prompt.txtand theget_reflection_evidencetool (agent-studio/tools/client-tools.json) in Agent Studio.Test plan
npm run lintnpm run typechecknpm test(99 web, 414 server)Made with Cursor