feat(observability): add conversation archive viewer#519
feat(observability): add conversation archive viewer#519Komzpa wants to merge 4 commits intoSoju06:mainfrom
Conversation
71482a7 to
b997df7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b997df7201
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1853,7 +1876,20 @@ async def _stream_via_http( | |||
| raise ProxyResponseError(resp.status, error_payload) | |||
There was a problem hiding this comment.
Archive error payloads before raising on HTTP stream failures
In _stream_via_http, the resp.status >= 400 + raise_for_status branch raises ProxyResponseError immediately after parsing error_payload, so no archive record is written for the upstream failure body. Because the main proxy streaming path calls core_stream_responses(..., raise_for_status=True), common upstream 4xx/5xx failures end up with only the outbound request archived, which defeats request-level failure inspection in the new archive viewer.
Useful? React with 👍 / 👎.
|
|
||
| def _archive_path() -> Path: | ||
| settings = get_settings() | ||
| directory = Path(getattr(settings, "conversation_archive_dir")) |
There was a problem hiding this comment.
Expand user-home prefix for conversation archive directory
The archive path uses conversation_archive_dir directly without expanduser(). If operators follow the provided env example (~/.codex-lb/conversation-archive), Python treats ~ literally here, so archives are written under a relative ~/... directory instead of the user’s home. That can silently store sensitive archive files in an unexpected location and break retrieval assumptions.
Useful? React with 👍 / 👎.
69c84a1 to
ca6e96c
Compare
Summary
YYYY-MM-DDTHH.jsonl.gzfiles to limit live blast radius and keep recovery/scans boundedENOSPC, disk quota, and sqlite-style disk-full failures as archive disk pressure: pause archive writes briefly, drop archive records during the pause, and emit a rate-limited warning without traceback spamReview notes
Verification
/home/kom/proj/codex-lb/.venv/bin/python -m pytest tests/unit/test_conversation_archive.py -q(14 passed)/home/kom/proj/codex-lb/.venv/bin/ruff check app/core/conversation_archive.py tests/unit/test_conversation_archive.py/home/kom/proj/codex-lb/.venv/bin/ruff format --check app/core/conversation_archive.py tests/unit/test_conversation_archive.pygit diff --check/home/kom/proj/codex-lb/.venv/bin/python -m pytest tests/unit/test_conversation_archive.py tests/unit/test_proxy_api_websocket_auth.py tests/integration/test_http_responses_bridge.py::test_v1_responses_http_bridge_rebinds_after_upstream_previous_response_not_found tests/integration/test_http_responses_bridge.py::test_v1_responses_http_bridge_masks_anonymous_previous_response_not_found_with_inflight_request -q(27 passed)git diff --checkon touched backend/proxy test filesnpx --yes @fission-ai/openspec validate --specs(19 passed)codex-lb:release-diskpressure-46789ab11455/12455: stable/health, hourly archive write smoke, and simulatedENOSPCdisk-pressure pause smoke/health, hourly archive write smoke, and simulatedENOSPCdisk-pressure pause smoke.venv/bin/python -m ty check app/core/conversation_archive.py app/modules/conversation_archive tests/unit/test_conversation_archive.py;bun run test -- src/features/conversation-archive/schemas.test.ts src/features/dashboard/components/recent-requests-table.test.tsx;bun run typecheck;bun run lint -- src/features/conversation-archive src/features/dashboard/components/recent-requests-table.tsx(passes with pre-existing warnings in account-multi-select.tsx);bun run buildRelated issues