mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* fix(native-chat): a /compact sent while the agent works waits in line instead of being refused * test(native-chat): build the admission test's submissions without a type assertion * fix(native-chat): a /clear refused while the agent works says so plainly; a /compact behind an unsent message waits for it quietly * test(native-chat): name the admission test's cases for the sends they model * fix(native-chat): a /compact refused while the agent works reads plainly too; a command card offers no Edit * test(native-chat): a refused /compact reads the plain sentence * fix(native-chat): a refused command card is spent and said once; a command card offers Send while the agent is idle; /compact behind an unsent message is not taken * test(native-chat): keep the queued receipt's narrowing inside the wait * fix(native-chat): spend a command card only when its own turn says why; refuse a queued command without a hand-off, with its reason; a queue send on its way reads as sending * fix(native-chat): a recorded send is no sending card; queue lists land at once; a spent card's wait says to run it again; only /compact or /clear give way to returned text * refactor(native-chat): derive the sending cards inside the queued-messages hook * fix(native-chat): keep protocol-version and the agent-session params under the line limit; the send capabilities get their own module * fix(native-chat): with the agent idle, a command behind this window's own unsent message says it is still being sent * fix(native-chat): the queued-commands capability stays a plain constant beside the others; main's send capabilities back to its text * test(native-chat): keep the rewind suite under its line limit after main's growth * fix(native-chat): one import per module in the command send; a rewind on its way holds commands, tested * test(native-chat): type the rewind module mock with a type import * test(native-chat): a command card cut short by a restart waits or is kept like any card; kept-card captions name only controls shown * fix(native-chat): a held command card, which the queue skips, no longer forces later sends to queue * fix(native-chat): a command's refusal line goes once what it waits on is gone A refusal that names something the chat shows (the agent working, a pending prompt, background tasks, an unsent message) is said only while that still holds, derived each render, and dropped once it ends. Other composer errors are unchanged. * fix(mobile): a command's refusal banner goes once what it waits on is gone The phone's banner keeps a refusal naming the agent working or a pending prompt only while the chat still shows it, dropped each render once it ends. Background tasks, which the phone can't see, and generic errors behave as before. The host-reason mapping is shared with desktop. * fix(native-chat): a refusal behind an earlier message names whether it is being sent or offers Retry Each line now goes when its own state ends: a send that fails stops being sent, and a resend stops offering Retry. * test(native-chat): a Stop behind a typed /compact keeps the taken-back message on screen; the in-doubt case says so * fix(native-chat): a command refused while the queue is about to send reads working, as the pane does * Update held command fixture for the merged queue model * Restart one host at a time in the recovery ordering test * fix: preserve person queue reserve for chat commands
35 lines
1.7 KiB
TypeScript
35 lines
1.7 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { appendReturnedDraftText } from './returned-draft-text'
|
|
|
|
describe('appendReturnedDraftText', () => {
|
|
it('fills an empty composer with the returned text as it was typed', () => {
|
|
expect(appendReturnedDraftText('', 'ping ')).toBe('ping ')
|
|
expect(appendReturnedDraftText(' \n', 'ping')).toBe('ping')
|
|
})
|
|
|
|
it('puts the returned text after a draft, a blank line apart', () => {
|
|
expect(appendReturnedDraftText('newer edit\n', 'ping')).toBe('newer edit\n\nping')
|
|
})
|
|
|
|
it('adds nothing when the draft already ends with that text', () => {
|
|
expect(appendReturnedDraftText('ping', 'ping')).toBe('ping')
|
|
expect(appendReturnedDraftText('first\n\nping\n', 'ping ')).toBe('first\n\nping\n')
|
|
expect(appendReturnedDraftText('ping', '')).toBe('ping')
|
|
})
|
|
|
|
it('still appends text that only ends a line of the draft', () => {
|
|
expect(appendReturnedDraftText('say ping', 'ping')).toBe('say ping\n\nping')
|
|
})
|
|
|
|
it('a lone conversation command gives way to the message handed back, which it could not carry', () => {
|
|
expect(appendReturnedDraftText('/compact', 'my message')).toBe('my message')
|
|
expect(appendReturnedDraftText(' /clear\n', 'my message')).toBe('my message')
|
|
// Anything more than the command is the person's text, and stays.
|
|
expect(appendReturnedDraftText('/compact now', 'my message')).toBe('/compact now\n\nmy message')
|
|
expect(appendReturnedDraftText('a/b', 'my message')).toBe('a/b\n\nmy message')
|
|
// A slash word that is not a conversation command is the person's text too.
|
|
expect(appendReturnedDraftText('/clearly', 'my message')).toBe('/clearly\n\nmy message')
|
|
expect(appendReturnedDraftText('/tmp', 'my message')).toBe('/tmp\n\nmy message')
|
|
})
|
|
})
|