Skip to content

fix(native-chat): never refuse a queued card because 20 were waiting, and keep the queue from covering the chat - #26553

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mail-nudges-keep-user-queue
Oct 8, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mail-nudges-keep-user-queue

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​190 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​184
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​99 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69

ELI5

When an agent is busy, messages sent to its native chat by other agents wait as cards above the box you type in. Each automatic "you have new messages" notice from another agent gets its own card. Orca refused every new card once 20 were waiting. So on a busy coordinator chat, further notices and task hand-offs from other agents were turned away. The card list also had no height limit, so 20 cards could push the conversation and the message box off the screen. This PR removes the 20-card limit and makes the card list scroll inside a fixed height.

What Changed

Before (shipped builds):

  • In a busy native chat, the 21st waiting card was refused. Today only other agents' sends become cards; the messages you type go straight into the running turn. So what got refused was other agents' work:
    • automatic notices about new orchestration mail: past 20 they got no card and no error, and you couldn't see or Steer them. Our before run (25 notices) showed them arriving as one combined notice after the turn ended;
    • task hand-offs into that chat: the coordinator got "The task was refused" (from the code; not run live).
  • The card list grew without a height limit. In our before run, 20 notice cards made the list 979 px tall. The conversation shrank to nothing and the message box was pushed below the bottom of the window.

After (what you see):

  • Any number of cards can wait. Other agents' notices and tasks are always queued, as one card each, exactly as on main.
  • The card list stays at a fixed height and scrolls inside it, so the conversation and the message box always stay on screen.
  • Queueing your own typed messages is not switched on yet, on desktop or phone: both wait for the host to advertise it, and it is held back on purpose. Once it is on, your queued card scrolls into view, and other agents' cards can never fill the room your message needs. That path is unit-tested only.
  • One limit remains, on total text rather than number of cards (see below). Hitting it says why and what to do: "Too much text is waiting in the queue. Your message was not sent. Delete a queued message, or wait for one to go through, then try again."

Mechanism:

  • structured-agent-session-queued-messages.ts: the count limit (QUEUED_MESSAGES_MAX_COUNT = 20) is removed.
  • The 1 MiB total-text limit is kept and renamed QUEUED_MESSAGES_PUBLISHED_MAX_BYTES (structured-agent-session-queued-published-bytes.ts). The reason: every waiting card's full text is included each time a phone or paired computer opens the chat, right beside a page of history of up to 2 MiB. Remote connections close the whole session on any single message over 4 MiB. The limit is now derived from those two constants.
  • Cards sent by other agents (orchestration notices, task hand-offs) must leave one maximum-size message's worth of room free (256 KiB). So other agents alone can never fill the limit and refuse your message. Your own earlier cards still count toward it.
  • The refusal now carries a reason (queueTooLarge), and clients show it in plain words. When a recorded failure is replayed, its message is kept, so the next refusal of this kind can be diagnosed from the record.
  • NativeChatQueuedMessageList: the card list scrolls within a fixed maximum height (max-h-40, the same bound the task and background-task lists next to it use). When you queue a card, the list scrolls to it before the next frame is drawn. A queue that is still loading when the chat opens shows its next card to send first.

Why

The 20-card limit was a quota that every sender shared. Hitting it was a bookkeeping state, not a problem with the message: agents' notices and tasks were turned away, and once queueing your own messages ships, your messages would have been too. Removing it fixes the problem at its source. A separate lane or a bigger number could fill up the same way.

Alternatives considered:

  • Hold other agents' notices until the chat is idle, then send one combined notice. This was in this PR's first version and was taken out. It changes what you see (no card for an agent's message while the chat is busy), which is a product decision of its own and conflicts with draft feat(orchestration): let an agent steer its message into a busy chat instead of queueing it #26110, whose default keeps the card. Review also found cases where a held notice was never delivered. It is not needed to fix the refusal.
  • Remove the 1 MiB text limit too. Without it, a few very large queued messages (a big task spec, or later a pasted message), plus a full page of history, make the message that opens the chat on a phone or paired computer too big to send, and that connection closes on every reconnect. The real fix is to send only a short preview of each card, which changes what goes over the network and is a follow-up. Until then, keeping the byte limit, with room reserved for your message, is the safe choice.

Differences from the common pattern:

  • Intended: the common pattern puts no limit at all on a person's queued messages. Orca keeps a 1 MiB total-text limit because the queue is sent whole to remote clients. Other agents' cards can never use the room kept for your message.
  • Temporary: the limit goes away once each card is sent as a short preview with the full text loaded on demand. That needs a version-negotiated wire change. No ticket yet.

Linked Issue

Found while investigating a refused send in a busy coordinator chat. That refusal itself came from the separate retry-record limit fixed in #26543; this PR fixes the same class of problem in the message queue. There's no separate issue. Author: @BrennanKB5.

Visual Proof

QA ran on a hidden Electron rig on macOS, using isolated profiles and a test agent that holds its turn open. Other agents' notices were real orchestration send calls, and the UI was driven through the Chrome DevTools Protocol. Full-window screenshots.

Before (base 5252884a9c7): 20 notice cards. The list is 979 px tall, and the conversation and message box have been pushed off the screen. Notices 21-25 got no card and no error.

Before: 20 cards push the conversation and composer off screen

After (9f5fecbd231): 26 notice cards. The list stays 160 px tall and scrolls, and the conversation and message box stay visible and usable.

After: 26 cards in a bounded, scrolling list

After, the list scrolled to its end, with card 21 accepted and visible:

After: card 21 at the bottom of the scrolled list

After the turn ended, all 26 cards drained in order, one turn each, with no notice or error.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • End to end: more than 20 automatic orchestration notices reach a busy coordinator chat through the real notice path and are all queued; a person's queued message is still accepted after them (structured-chat-coordinator-mail-queue.test.ts).

  • Unit:

    • the 21st and later person's cards are accepted;
    • the text limit refuses readably, and deleting a card makes room;
    • other agents' cards stop at the reserved room, and a maximum-size person's message still fits;
    • the failed-send record keeps its message;
    • the list scrolls only for the person's newly queued card, not when cards first load.
  • Targeted suites pass. pnpm tc:node and pnpm tc:web pass. CI-equivalent static checks pass 22/22. CI passes on the final head.

  • Manual: hidden Electron rig on macOS, before and after builds (see Visual Proof).

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • The fix runs where the agent runs. A new desktop or phone talking to an older paired host still sees the 20-card limit until that host updates. An older client receiving the new reason shows its generic "Your message was not sent." words, which is no worse than before.
  • The whole class needs both PRs. The retry-record limit that can also refuse a send under heavy background traffic is fixed separately in fix(native-chat): never refuse a user's write because the retry record is full #26543.
  • Follow-up (not caused by this PR): the phone's queue list has no height limit either. It already overflowed a phone screen at about 12 cards under the old limit.
  • No schema, setting or wire-shape change. The new refusal reason is additive and old clients ignore it.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

brennanb2025 and others added 4 commits October 8, 2026 03:52
Orchestration mail reached a busy chat as ordinary queued message cards, and
the queue refused at 20 unsettled cards or 1 MiB with a bare invalid
refusal, so automatic notices could fill it and refuse the user's own next
queued message. Mail now stays unread while the chat is working, waiting on
a prompt or holding unsettled cards, and is coalesced into one delivery when
it becomes free; batch identity is recorded so nothing is delivered twice.
Human drafts no longer share an aggregate quota, and a failed settled
receipt keeps its code, details and message for diagnosis.

Co-Authored-By: OpenAI Codex gpt-6.1-sol <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d the queue

Drop the 20-card queue limit and the mail-delivery rework; keep only a byte
bound on what queued cards publish (it rides every opening frame beside the
history page), refused with a reason that says what to do. The desktop queue
list now scrolls instead of squeezing the transcript.
… agents fill

Other agents' cards stop one maximal message short of the queued-bytes bound,
so background work alone can never refuse a person's send. The person's newly
queued card scrolls into view, and the refusal's step and host message now name
only what the person can do.
@brennanb2025 brennanb2025 changed the title fix(orchestration): keep automatic mail out of the user's message queue fix(native-chat): never refuse a queued card because 20 were waiting, and keep the queue from covering the chat Oct 8, 2026
@brennanb2025

brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Review summary

The problem. In a busy native chat, every queued card shared one limit of 20. On shipped builds the messages you type don't queue: they go straight into the running turn, because person queueing is still behind an unreleased capability. So the cards come from other agents: one "you have N orchestration messages" notice per mail, plus task hand-offs. When a busy coordinator chat reached 20 cards:

  • the next notices got no card and no error;
  • task hand-offs into that chat were refused;
  • the card list, which had no height limit, pushed the conversation and the message box off the screen. In the before run, 20 cards made the list 979 px tall.

What changes for you.

  • Any number of cards can wait, so other agents' notices and tasks are always accepted as cards, one per arrival, exactly as on main.
  • The card list stays 160 px tall and scrolls, so the chat and the message box stay usable.
  • Once person queueing ships, your just-queued card scrolls into view, and other agents' cards can never take the room your message needs.

How the PR changed during review.

  • The first version also held other agents' notices back while the chat was busy and then sent one combined notice. It added schema v44 and new resend rules. Review took that out because:
  • With it gone, this PR adds no schema and touches none of feat(orchestration): let an agent steer its message into a busy chat instead of queueing it #26110's files. Whether busy-chat notices should be combined is a separate product question.
  • Fixed in review:
    • kept the 1 MiB total-text limit, now as a frame bound for phones and paired clients (any frame over 4 MiB closes that session), instead of removing it;
    • kept 257 KiB inside that limit that only the person can use;
    • a plain refusal with a reason (queueTooLarge) and next step;
    • the bounded, scrolling card list;
    • your new card scrolls into view, which doesn't happen when the queue first loads, and before paint;
    • the refusal step names only the controls on screen;
    • removed stale comments.
  • Deferred:
    • the phone's queue list has no height limit either. Under the old limit it already overflowed a phone screen at about 12 cards, so this PR didn't create it. Follow-up: a scroll view with a maximum height.
    • sending a short preview of each card instead of its full text, so the 1 MiB limit can go too. This is a version-negotiated wire change; until then the limit stays as the intended difference from the common pattern.
    • an older host still enforces 20 cards until it updates;
    • the retry-record limit (fix(native-chat): never refuse a user's write because the retry record is full #26543) is the other half of this class;
    • wording nits: "wait for one to go through" doesn't fit a paused queue; personsMessage is threaded through but unused.

Verified.

  • Four review rounds: a whole-PR adversarial review plus an independent design challenge, a full re-review after the cut, then narrow checks of each fix. A final readiness pass found no P0, P1 or P2.
  • Targeted suites pass, including an end-to-end test where more than 20 real notices are queued and a person's queued message is still accepted. tc:node and tc:web pass, and CI-equivalent static checks pass 22/22.
  • CI on 9f5fecbd231: 20 checks passed, 17 skipped, none failed.
  • Live macOS hidden-rig QA, before and after:
    • before: 20 cards cover the chat, and notices 21-25 get no card;
    • after: 26 cards in a bounded list, chat usable, all cards drain in order. Screenshots are in the PR body.

Seen in QA, not caused by this PR (deferred).

  • Every agent notice card shows the raw command "Run orca-dev orchestration check". That is an internal command in text you read. Brennan: worth a copy follow-up.
  • The capped list has no card count; only the half-cut 4th card hints that it scrolls.
  • Agent Session History lists the chat twice.
  • A "macOS is blocking Orca notifications" toast flashes at startup.

Not verified.

  • The person-queued path: your own card scrolling into view, and the 257 KiB reserved for your message. It can't be reached on desktop or phone while queueing your own messages is switched off, so phone emulator QA would not exercise it. It is unit-tested only.
  • Windows and Linux, a real SSH host, a phone or paired client, mixed-version peers, and the 1 MiB refusal live. The refusal and the person reserve are unit-tested. An old client receiving the new reason falls back to its generic words, checked in code.
  • A task hand-off refused at 20 cards was read from the code, not run live.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 8, 2026 13:32
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The queue acceptance path replaces its count-and-byte refusal check with a published-byte bound and a reserve for person messages. Oversized queues return a queueTooLarge refusal with recovery guidance. Failed operation outcomes retain the refusal message. The queued-message list now has bounded vertical scrolling and scrolls to newly appended person-queued cards.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 9f5fe

A large queue of short messages could disconnect a remote chat session, and a newly queued message can sometimes remain out of view. Account for the full published queue size before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files. (7 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the two main changes: removing the 20-card refusal and preventing the queue from covering the chat. It is slightly long but remains specific and understandable.
Description check ✅ Passed The description is detailed and covers the required explanation, changes, rationale, testing, visual proof, compatibility notes, and checklist. The Linked Issue field has no actual issue link, and the…
Full details: Docstring Coverage

Explanation

Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eba775b0-00cd-4cbb-85e9-72d06e96d1aa
📥 Commits

Reviewing files that changed from the base of the PR and between e0a98a4 and 9f5fecb.

📒 Files selected for processing (23)
  • src/main/native-chat/agent-session-journal/queued-message-table.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-operation-settlement.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-operation-settlement.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-messages.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-messages.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-published-bytes.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-published-bytes.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-send.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-stop.ts
  • src/main/runtime/structured-chat-coordinator-mail-queue.test.ts
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsx
  • src/renderer/src/components/native-chat/agent-session-write-notice-text.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-session-refusal-details.ts
  • src/shared/agent-session-refusal-reason-words.ts
  • src/shared/agent-session-write-notice-copy.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment on lines +15 to +16
export const QUEUED_MESSAGES_PUBLISHED_MAX_BYTES =
(REMOTE_RUNTIME_MAX_OUTBOUND_JSON_BYTES - AGENT_SESSION_HISTORY_MAX_PAGE_BYTES) / 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect the queue projection and the frame/page limits; do not run repository code.
rg -n -C 5 'queuedMessages:|queuedMessages\s*=|REMOTE_RUNTIME_MAX_OUTBOUND_JSON_BYTES|AGENT_SESSION_HISTORY_MAX_PAGE_BYTES' \
  src/main/native-chat src/shared

Repository: stablyai/orca

Length of output: 41695


🏁 Script executed:

set -eu
printf '%s\n' '--- target byte-bound module ---'
nl -ba src/main/native-chat/agent-session-wire/structured-agent-session-queued-published-bytes.ts
printf '%s\n' '--- queue publication module ---'
nl -ba src/main/native-chat/agent-session-wire/structured-agent-session-queued-publication.ts | sed -n '1,240p'
printf '%s\n' '--- queue projection definition ---'
nl -ba src/main/native-chat/agent-session-wire/structured-agent-session-queued-publication.ts | sed -n '1,115p'
printf '%s\n' '--- history page bounds ---'
rg -n -C 8 -F -- 'AGENT_SESSION_HISTORY_MAX_PAGE_BYTES' src/main/native-chat/agent-session-wire src/shared
printf '%s\n' '--- byte-refusal call sites ---'
rg -n -C 8 -F -- 'queuedMessagesPublishedBytesRefusal' src/main/native-chat src/shared
printf '%s\n' '--- queued publication consumers ---'
rg -n -C 8 -F -- 'readQueuePublication' src/main/native-chat/agent-session-wire

Repository: stablyai/orca

Length of output: 42126


🏁 Script executed:

set -eu
nl -ba src/main/native-chat/agent-session-wire/structured-agent-session-queued-published-bytes.ts
printf '%s\n' '--- projection ---'
nl -ba src/main/native-chat/agent-session-wire/structured-agent-session-queued-publication.ts | sed -n '1,180p'
printf '%s\n' '--- refusal callers ---'
rg -n -C 12 -F -- 'queuedMessagesPublishedBytesRefusal' src/main/native-chat
printf '%s\n' '--- history bound declarations and uses ---'
rg -n -C 8 -F -- 'AGENT_SESSION_HISTORY_MAX_PAGE_BYTES' src/main/native-chat/agent-session-wire

Repository: stablyai/orca

Length of output: 42399


🏁 Script executed:

set -eu
for f in \
  src/main/native-chat/agent-session-wire/structured-agent-session-queued-published-bytes.ts \
  src/main/native-chat/agent-session-wire/structured-agent-session-queued-publication.ts; do
  echo "--- $f ---"
  cat "$f"
done
rg -n -C 10 -F -- 'queuedMessagesPublishedBytesRefusal' src/main/native-chat
rg -n -C 10 -F -- 'serializeRemoteRuntimePayload' src/main/native-chat src/shared

Repository: stablyai/orca

Length of output: 41910


Include card metadata in the published-size bound.

queuedMessagesPublishedBytesRefusal sums only JSON.stringify of each body. The published queue also includes messageId, position, state, pause fields, return fields, queuePause, and nextQueuedMessageId. Since the queue has no card-count limit, metadata can consume the remaining frame budget and push a hydrating frame above REMOTE_RUNTIME_MAX_OUTBOUND_JSON_BYTES, which closes the remote session.

Measure the complete serialized queue publication, using the same projection that readQueuePublication sends, and preserve the existing person-message reserve.

Comment on lines +29 to +42
const listRef = useRef<HTMLUListElement>(null)
const newestPosition = newest?.position ?? 0
const newestIsPersons = newest !== undefined && !newest.from
const shownPosition = useRef(newestPosition)
// Before paint, so the new card never shows a frame before the scroll.
useLayoutEffect(() => {
// From 0 the queue is loading or holds one card: nothing to scroll to.
const appended = shownPosition.current > 0 && newestPosition > shownPosition.current
shownPosition.current = newestPosition
// The list opens on the next card to send; a card the person just queued is shown instead.
if (appended && newestIsPersons && listRef.current) {
listRef.current.scrollTop = listRef.current.scrollHeight
}
}, [newestPosition, newestIsPersons])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check how queued message positions are assigned.
rg -n -C4 'position' src/main/native-chat/agent-session-journal/queued-message-table.ts

Repository: stablyai/orca

Length of output: 3160


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- insertQueuedMessage callers ---'
rg -n -C5 --glob '*.{ts,tsx}' 'insertQueuedMessage\(' src || true
printf '%s\n' '--- queued_messages schema and mutations ---'
rg -n -C4 --glob '*.{ts,tsx,sql}' 'queued_messages|DELETE FROM queued_messages|UPDATE queued_messages|position:' src/main src/renderer || true
printf '%s\n' '--- NativeChatQueuedMessageList ---'
sed -n '1,220p' src/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsx

Repository: stablyai/orca

Length of output: 45657


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- journal enqueue and move blocks ---'
sed -n '100,235p' src/main/native-chat/agent-session-journal/journal-queued-messages.ts
printf '%s\n' '--- queue table mutation definitions ---'
rg -n -C6 -F -- 'DELETE FROM queued_messages' src/main/native-chat/agent-session-journal || true
rg -n -C6 -F -- 'UPDATE queued_messages' src/main/native-chat/agent-session-journal || true
rg -n -C6 -F -- 'moveQueuedMessages' src/main/native-chat/agent-session-journal || true
printf '%s\n' '--- position-bearing input declarations and uses ---'
rg -n -C5 -F -- 'position?: number' src/main/native-chat/agent-session-journal
rg -n -C5 -F -- 'position:' src/main/native-chat/agent-session-journal/journal-queued-messages.ts

Repository: stablyai/orca

Length of output: 29784


Use an immutable enqueue sequence for the scroll trigger.

position is mutable and can be reused. Retention deletes old queue rows, and the next insert assigns MAX(position) + 1 from the remaining rows. If a deleted highest-position card is replaced before an intermediate render, the new person card can have the same newestPosition. The newestPosition > shownPosition.current check is then false, so the list does not scroll.

Track an immutable enqueue sequence or card identity for this comparison instead of relying on position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant