Skip to content

fix: return error on Codex response.failed instead of treating as success#889

Open
henkedk wants to merge 8 commits intonextlevelbuilder:mainfrom
henkedk:fix/codex-response-failed-silent
Open

fix: return error on Codex response.failed instead of treating as success#889
henkedk wants to merge 8 commits intonextlevelbuilder:mainfrom
henkedk:fix/codex-response-failed-silent

Conversation

@henkedk
Copy link
Copy Markdown
Contributor

@henkedk henkedk commented Apr 13, 2026

Fixes #888

processSSEEvent had no return value, so response.failed was handled in the same switch case as response.completed. Server-side Codex failures during generation were silently swallowed — no error, no retry, user got "...".

Changes:

  • Added codexErrorDetail struct to codex_types.go (Code, Message fields)
  • processSSEEvent now returns error
  • response.failed separated from success case, returns error with message/code from the failed response
  • SSE loop checks returned error and propagates through ChatStream → think stage → formatAgentError

Reviewed by Lars (Codex). Approved — correct error propagation, no false-positive risk on legitimate empty responses.

Jens Henke added 8 commits April 13, 2026 10:38
Re-applied 4 local patches not yet upstream:
- NoSandbox browser option (3 files)
- Telegram Groups config wiring from DB
- SharedKG context injection in bridge middleware
- Softer confidentiality rules for owner diagnostics
- bridge_server.go: remove BridgeToolNames allowlist, register all tools from registry
- message.go: add buildMessageOutMeta for forum topic/thread routing in proactive messages
- agents.go: restrict_to_workspace comment fix from stash
…routing

- team_tasks_lifecycle.go executeComplete: read local_key from task metadata
  instead of member agent context (which doesn't have the originating topic key)
- gateway_consumer_post_turn.go: extract taskLocalKey from task metadata and
  include WithLocalKey in all three auto-complete/auto-fail broadcasts
  (agent error, loop-detector kill, auto-complete)
Previously task_number was scoped per (team_id, chat_id), allowing duplicate
numbers across different chats in the same team. Fixed to be unique per team.

- pg/teams_tasks.go: MAX query now uses WHERE team_id = $1 only
- sqlitestore/teams_tasks.go: same fix for SQLite
- migrations/000050: deduplicate existing rows + add UNIQUE(team_id, task_number)
- sqlitestore/schema.sql: add idx_tt_team_number unique index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant