mirror of
https://github.com/stablyai/orca.git
synced 2026-09-25 08:02:31 +00:00
* fix(agents): recognize OpenCode native OC | tab titles OpenCode's native OSC titles use `OC | <task>` without an `opencode` token, so title classifiers left tabs as Claude/unknown. Map the native marker (optional mux prefix) to OpenCode identity in both title classifiers, exclude it from isClaudeAgent, and cover lookalikes plus stale Claude launch reclaim. Builds on and supersedes #8590 (credit @gatsby74). Fixes #8478. * fix(agents): drop renderer import from #8478 shared repro tsconfig.node includes src/shared tests; importing agent-status pulled renderer modules outside the node project and failed typecheck. Assert opencode identity via shared title classifiers only (OpenCode TUI sets "OpenCode" and `OC | ${title}`). * fix(runtime): fill browser cert failure map in mobile snapshot fixtures Main's #9104 reads browserCertificateFailuresByPageId in buildMobileBrowserTab but left partial AppState test helpers without the field, breaking PR Checks merge commits. Default the map in fixtures and use optional chaining so partial state cannot throw.
24 lines
1.3 KiB
TypeScript
24 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { isMeaningfulOpenCodeTerminalTitle, isOpenCodeNativeTitle } from './opencode-terminal-title'
|
|
|
|
describe('OpenCode terminal titles', () => {
|
|
it('recognizes native session titles', () => {
|
|
expect(isMeaningfulOpenCodeTerminalTitle('OC | Native Stable Session')).toBe(true)
|
|
expect(isMeaningfulOpenCodeTerminalTitle(' OC|Session ')).toBe(true)
|
|
expect(isOpenCodeNativeTitle('OC | Understand about the plugin')).toBe(true)
|
|
expect(isOpenCodeNativeTitle('tmux | OC | ses_123')).toBe(true)
|
|
})
|
|
|
|
it('rejects generic, incomplete, embedded, and lookalike titles', () => {
|
|
expect(isMeaningfulOpenCodeTerminalTitle('OpenCode')).toBe(false)
|
|
expect(isMeaningfulOpenCodeTerminalTitle('OpenCode ready')).toBe(false)
|
|
expect(isMeaningfulOpenCodeTerminalTitle('OC |')).toBe(false)
|
|
expect(isMeaningfulOpenCodeTerminalTitle(undefined)).toBe(false)
|
|
// Why: lowercase is not OpenCode's native marker; avoid "oc |" cwd/task noise.
|
|
expect(isOpenCodeNativeTitle('oc | Understand about the plugin')).toBe(false)
|
|
// Why: mid-title OC must not steal another agent's braille/task frame.
|
|
expect(isOpenCodeNativeTitle('⠋ Fix foo | OC | bar')).toBe(false)
|
|
expect(isOpenCodeNativeTitle('my session | OC | task')).toBe(false)
|
|
})
|
|
})
|