Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1.4 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import {
  isWordlessProviderFrame,
  type ProviderFrameRowText
} from './native-chat-provider-frame-summary'

function frameRow(provider: string, kind: string, extra: Partial<ProviderFrameRowText> = {}) {
  return { text: `${provider} · ${kind}`, providerFrame: { provider, kind }, ...extra }
}

describe('isWordlessProviderFrame', () => {
  it('reads a row whose only text is the host fallback label as wordless', () => {
    expect(isWordlessProviderFrame(frameRow('codex', 'notification:future/event'))).toBe(true)
  })

  it('keeps rows that carry words, a tone, a failure or an answered request', () => {
    expect(
      isWordlessProviderFrame({ ...frameRow('codex', 'notification:x'), text: 'Sandbox degraded' })
    ).toBe(false)
    expect(isWordlessProviderFrame(frameRow('codex', 'notification:x', { tone: 'error' }))).toBe(
      false
    )
    expect(isWordlessProviderFrame(frameRow('codex', 'request:future/request'))).toBe(false)
    expect(isWordlessProviderFrame({ text: 'plain status' })).toBe(false)
  })

  // Older hosts stored /usage output only in payload; keep their labeled rows visible.
  it("keeps a Claude local command's row an older host wrote with only the label", () => {
    expect(isWordlessProviderFrame(frameRow('claude', 'message:system:local_command_output'))).toBe(
      false
    )
  })
})