Fix Codex hook waiting state

This commit is contained in:
brennanb2025 2026-04-14 15:50:39 -07:00
parent 6dd2fa9b3c
commit ec50b83fc8
2 changed files with 7 additions and 3 deletions

View file

@ -10,7 +10,11 @@ import {
type HookDefinition
} from '../agent-hooks/installer-utils'
const CODEX_EVENTS = ['SessionStart', 'UserPromptSubmit', 'Stop'] as const
// Why: Codex permission prompts arrive through PreToolUse hook callbacks. Orca
// maps that event to the waiting state, so the managed hook registration must
// subscribe to PreToolUse or the sidebar can never show Codex as blocked on
// approval.
const CODEX_EVENTS = ['SessionStart', 'UserPromptSubmit', 'PreToolUse', 'Stop'] as const
function getConfigPath(): string {
return join(homedir(), '.codex', 'hooks.json')

View file

@ -87,13 +87,13 @@ describe('parseAgentStatusPayload', () => {
expect(result!.next).toBe('')
})
it('ignores invalid agentType values', () => {
it('accepts custom non-empty agentType values', () => {
const result = parseAgentStatusPayload('{"state":"working","agentType":"cursor"}')
expect(result).toEqual({
state: 'working',
summary: '',
next: '',
agentType: undefined
agentType: 'cursor'
})
})
})