fix(codex): surface thread system errors (#519)

Co-authored-by: Liu-KM <Liu-KM@users.noreply.github.com>
This commit is contained in:
Qianli Liu
2026-04-23 20:45:33 +08:00
committed by GitHub
co-authored by Liu-KM
parent 96d766d7f1
commit 19e74456fb
6 changed files with 171 additions and 19 deletions
@@ -44,6 +44,32 @@ describe('shouldIgnoreTerminalEvent', () => {
expect(ignored).toBe(true);
});
it('accepts thread-level terminal events for the current thread when explicitly allowed', () => {
const ignored = shouldIgnoreTerminalEvent({
eventTurnId: null,
currentTurnId: 'turn-1',
turnInFlight: true,
eventThreadId: 'thread-1',
currentThreadId: 'thread-1',
allowMatchingThreadIdTerminalEvent: true
});
expect(ignored).toBe(false);
});
it('ignores thread-level terminal events for a different thread', () => {
const ignored = shouldIgnoreTerminalEvent({
eventTurnId: null,
currentTurnId: 'turn-1',
turnInFlight: true,
eventThreadId: 'thread-old',
currentThreadId: 'thread-1',
allowMatchingThreadIdTerminalEvent: true
});
expect(ignored).toBe(true);
});
it('ignores stale terminal events from another turn', () => {
const ignored = shouldIgnoreTerminalEvent({
eventTurnId: 'turn-old',