Skip to content

fix(compact): live-carrier for tool search pairs - #1607

Closed
Komzpa wants to merge 78 commits into
mainfrom
fix/live-compact-tool-search-carrier
Closed

fix(compact): live-carrier for tool search pairs#1607
Komzpa wants to merge 78 commits into
mainfrom
fix/live-compact-tool-search-carrier

Conversation

@Komzpa

@Komzpa Komzpa commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Temporary live-stack carrier based on deployed head d747bc4986841d3237c2c9db14e0c4767b9f4c94 plus the focused compact fix from #1606. This exists because the current recorded overlay list no longer assembles from fresh origin/main: helper assembly conflicts immediately on #1555.

The actual new behavior is the same as #1606: preserve tool_search_call / tool_search_output pairs during compact input trimming so session 019fcc77-8e08-7f02-b5d2-3388c5122004 does not send an orphan tool_search_output for call_d2chifMNZfXqfFWin5jz0dQf.

Type of change

  • fix: — bug fix (no behavior change beyond the bug)

Linked issue: none; runtime incident for session 019fcc77-8e08-7f02-b5d2-3388c5122004

OpenSpec

  • Not applicable — bug fix that matches the existing spec
  • This PR touches a codex-faithful path (image pipeline, request/response shape, SSE framing, OAuth flow) and preserves upstream-equivalent behavior

Change directory: n/a

Changes

  • Carries the currently deployed live stack head forward unchanged.
  • Adds tool_search_call and tool_search_output to compact pair reconciliation.
  • Adds a live-shaped regression test for the tool-search pair.

Test plan

/home/kom/proj/codex-lb/.venv/bin/python -m pytest tests/unit/test_openai_requests.py -k 'tool_search_outputs or compact_trimming_keeps_selected_tool_outputs_with_matching_calls or compact_trimming_drops_selected_tool_outputs_without_matching_calls or compact_trimming_reconciles_duplicate_tool_call_ids_by_occurrence' -q\n# 4 passed, 146 deselected\n\n/home/kom/proj/codex-lb/.venv/bin/python -m pytest tests/integration/test_proxy_compact.py -k 'compact_strips_tool_fields or side_effect_pair' -q\n# 2 passed, 25 deselected\n\ngit diff --check d747bc4986841d3237c2c9db14e0c4767b9f4c94..HEAD\n```\n\n## Screenshots / output\n\nExact live replay from `/home/kom/.codex/sessions/2026/08/04/rollout-2026-08-04T15-10-15-019fcc77-8e08-7f02-b5d2-3388c5122004.jsonl` through `ResponsesCompactRequest.to_payload()` preserved both `tool_search_call` and `tool_search_output`; `has_orphan_tool_search_output` was `False`.\n\n## Checklist\n\n- [x] Title is in Conventional Commits format (`<type>(<scope>)?: <subject>`).\n- [ ] Linked the related issue / discussion above.\n- [x] Added or updated tests covering the change.\n- [ ] Ran `uv run pre-commit run local-ci --hook-stage manual --all-files` or the relevant `make <target>` subset locally.\n- [ ] If touching specs: `openspec validate --specs` passes and `/opsx:verify` is clean.\n- [x] Simplicity gates reviewed: the five simplicity rules (PRINCIPLES.md P1-P5).\n- [x] CHANGELOG is **not** edited by hand (release-please handles it).\n

Omnidia Agent and others added 30 commits July 30, 2026 07:54
The takeover of #1247 hardens selection_failure_response: instead of a
private duplicate of the account-cap code set, local capacity codes are
resolved via app.core.resilience.overload.LOCAL_OVERLOAD_CODES. This keeps
every local overload code (including codes added later, such as the
congestion fair-share code from #1536) on the stable 429 rate_limit_error
contract, and guarantees the new usage_limit_reached 429 mapping is applied
strictly to upstream usage/quota exhaustion of the whole eligible pool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds externally-routed regressions for the takeover of #1247:

- /v1/responses and /backend-api/codex/responses return HTTP 429 with
  error.type = error.code = usage_limit_reached (and authoritative
  error.resets_at) when every eligible account is usage-exhausted
- resets_at is omitted when selection has no authoritative reset
- paused/deactivated/reauth-only pools keep the pre-existing no_accounts
  semantics, and the synthetic SSE failure keeps the #1479 sequenced
  response.created/response.failed SDK stream contract
- one usable account still fails over with no error

Also tightens the OpenSpec delta: authoritative-reset-only resets_at,
terminal (non-waitable) usage-limit failures, local capacity codes keep
their rate_limit_error contract, owner-scoped exhaustion keeps continuity
semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
OpenClaw codex-lb stack assembler and others added 22 commits August 2, 2026 03:47
Signed-off-by: Darafei Praliaskouski <me@komzpa.net>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label Aug 5, 2026
api_key.id,
request_id,
retry_attempt,
retry_delay_seconds,
@Komzpa Komzpa closed this Aug 5, 2026
@Komzpa
Komzpa deleted the fix/live-compact-tool-search-carrier branch August 5, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db migration PR changes Alembic database migrations; maintainer must coordinate merge order

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants