Merge pull request #27971 from NousResearch/austin/fix/goal-statusbar

fix(tui): keep /goal verdict out of compact status row
This commit is contained in:
Austin Pickett 2026-05-18 08:42:33 -04:00 committed by GitHub
parent d9b6f75c0b
commit 609c485fc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 54 additions and 5 deletions

View file

@ -4,7 +4,7 @@ import { createGatewayEventHandler } from '../app/createGatewayEventHandler.js'
import { getOverlayState, resetOverlayState } from '../app/overlayStore.js'
import { turnController } from '../app/turnController.js'
import { getTurnState, resetTurnState } from '../app/turnStore.js'
import { patchUiState, resetUiState } from '../app/uiStore.js'
import { getUiState, patchUiState, resetUiState } from '../app/uiStore.js'
import { estimateTokensRough } from '../lib/text.js'
import type { Msg } from '../types.js'
@ -132,6 +132,46 @@ describe('createGatewayEventHandler', () => {
expect(ctx.system.sys).toHaveBeenCalledWith('compressing 968 messages (~123,400 tok)…')
})
it('keeps goal verdict text in transcript but shows a brief idle status (#goal statusbar)', () => {
const appended: Msg[] = []
const ctx = buildCtx(appended)
const onEvent = createGatewayEventHandler(ctx)
const verdict = '✓ Goal achieved: long judge reason goes only in transcript, not merged with cwd label.'
vi.useFakeTimers()
try {
onEvent({
payload: { kind: 'goal', text: verdict },
type: 'status.update'
} as any)
expect(ctx.system.sys).toHaveBeenCalledWith(verdict)
expect(getUiState().status).toBe('✓ goal complete')
vi.advanceTimersByTime(6001)
expect(getUiState().status).toBe('ready')
} finally {
vi.useRealTimers()
}
})
it('maps goal status.update prefixes to short status strings', () => {
const ctx = buildCtx([])
const onEvent = createGatewayEventHandler(ctx)
onEvent({
payload: { kind: 'goal', text: '↻ Continuing toward goal (1/10): reason' },
type: 'status.update'
} as any)
expect(getUiState().status).toBe('↻ goal continuing')
onEvent({
payload: { kind: 'goal', text: '⏸ Goal paused — budget exhausted.' },
type: 'status.update'
} as any)
expect(getUiState().status).toBe('⏸ goal paused')
})
it('surfaces self-improvement review summaries as a persistent system line', () => {
const appended: Msg[] = []
const ctx = buildCtx(appended)

View file

@ -338,14 +338,23 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev:
return
}
setStatus(p.text)
if (p.kind === 'compressing') {
if (p.kind === 'goal') {
sys(p.text)
const brief = p.text.startsWith('✓')
? '✓ goal complete'
: p.text.startsWith('↻')
? '↻ goal continuing'
: p.text.startsWith('⏸')
? '⏸ goal paused'
: 'ready'
setStatus(brief)
restoreStatusAfter(6000)
return
}
if (p.kind === 'goal') {
setStatus(p.text)
if (p.kind === 'compressing') {
sys(p.text)
return
}