Skip to content

perf(logs): poll verified deltas without losing changed requests - #3800

Merged
lidge-jun merged 2 commits into
devfrom
codex/t4-04-log-polling-81a8
Sep 6, 2026
Merged

perf(logs): poll verified deltas without losing changed requests#3800
lidge-jun merged 2 commits into
devfrom
codex/t4-04-log-polling-81a8

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reimplement perf(logs): poll request history incrementally #3250 with bounded snapshot-prefix validation and process epochs. Preserve changed in-flight rows, derived metrics, reset/eviction behavior, legacy responses, generatedAt and current client cancellation guards. Stable-prefix polls reduce response bytes; server projection remains O(window bytes).
  • Manual review chain, layer 4/5; base codex/t4-03-antigravity-81a8. No GitHub native stack registration. Each layer is independently scoped; this chain batches review and final verification.

Verification

Manual review chain (bottom-up): #3797#3798#3799#3800#3801

  • Local test suites, typecheck and builds were not run, per maintainer instruction. Source audits and git diff --check were performed.
  • Final combined Cross-platform CI (lane=all) passed all 25 jobs on d1915c470bdcc95bbb3f7c716152ed013622634f. Lower test runs are deferred per the maintainer-directed combined-evidence strategy; skipped/cancelled runs are not passing evidence.
  • Independent Astra high source/security reviews and actual Aside fixture rendering are recorded where applicable. All scoped source/security reviews passed. Repaired-source remote diagnostics passed; the final full cross-platform matrix passed all 25 jobs.
  • Maintainer integration policy: the owner explicitly authorized final-combined-CI-first validation and eventual bottom-up admin merge. Exact combined CI is green; fresh per-PR head/base/actor and maintainer-objection checks precede each admin merge. Repository auto-delete is enabled, so the next owned child is retargeted to dev immediately before its parent lands.

Actual component/page with synthetic fixture data

  • Exact-source diagnostic gates, d1915c470bdcc95bbb3f7c716152ed013622634f: lint, typecheck, 27 focused config/picker tests, 1,706 GUI tests, privacy scan, GUI build and 425-page documentation build all passed. No deployment.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: chilung b0423031@gmail.com

t and others added 2 commits September 7, 2026 01:55
Reimplements #3250 with snapshot-prefix validation, process epochs and current response fences.

Co-authored-by: chilung <b0423031@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 50 / 80

지금 dev HEAD(24c761a05, package 2.45.0)의 GET /api/logs는 매번 필터된 전체 창을 내려줍니다. GUI Logs.tsxlimit=2000 전체 폴이라, 2초 폴마다 바이트가 큽니다. 이미 dev에는 #3508/#3712 로그 필터 엔진이 들어가 있어서 필터·상대시간 시계는 있지만, 증분 폴 프로토콜은 없습니다. 이 PR(DRAFT, Track4 81a8 스택 4/5, base=t4-03-antigravity, head=t4-04-log-polling)은 #3250을 다시 심습니다. 서버는 새 src/server/request-log-cursor.ts에서 process epoch + 쿼리 digest + 창 prefix/full 해시로 cursor를 만들고, 안정 prefix면 delta만, 변경·필터 변경·legacy cursor면 reset: true와 전체 창을 줍니다. 잘못된 cursor는 400 invalid_cursor입니다.

GUI는 새 gui/src/pages/log-poll.ts로 envelope를 파싱하고, mergeLogDelta로 append합니다. 캐시/리마운트/A→B→A는 cursor를 다시 안 가져갑니다. 실패·malformed는 last-good을 지키고, 명시 Retry만 full snapshot으로 돌아갑니다. logs-usage-routes.ts는 기존 filterRequestLogs 뒤에 selectRequestLogPoll을 붙이므로 #3712 필터와 겹치되 싸웁니다. 테스트·스크린샷·management-api 문서가 있습니다. checkout에는 Logs.tsx / logs-usage-routes.ts가 있고, log-poll.tsrequest-log-cursor.ts는 이 층에서 새로 생깁니다(발명이 아니라 PR 파일 목록과 일치).

src/server/request-log-cursor.ts - 매 폴마다 창 전체 JSON 해시라 CPU는 O(window bytes)다. 본문이 “바이트 절약, 서버 투영 비용은 남음”이라고 솔직히 적었다. 창이 커지면 비용 재측정이 필요하다.
src/server/request-log-cursor.ts processEpoch - 재시작 시 동일 usage.jsonl이라도 cursor 무효. 맞다.
gui/src/pages/log-poll.ts mergeLogDelta - 업데이트/삭제는 reset으로만 온다. append-only라 ID 중복 행이 생길 수 있고, 테스트가 그 선택을 고정한다.
gui/src/pages/Logs.tsx - cursor는 메모리 ref만. sessionStorage 캐시 행으로 cursor를 복원하지 않는 선택이 안전하다.
tests/server/management-api-logs-metrics.test.ts - append/mutation/eviction/filter/cost overlay/legacy/invalid 계약이 두껍다. auth 게이트 테스트도 cursor를 management 뒤에 둔다.
#3712 필터 - 폴은 필터 이후 창에 걸린다. 필터 엔진 회귀를 이 층이 깨지 않는지 스택 CI에서 같이 보면 된다.

메인테이너의 판단이 필요한 지점

너의 추천
DRAFT 유지. #3712와 맞물리는 중우선 성능 작업이라 점수 중간. Track4 아래 층이 준비되고 결합 CI가 초록이면 #3799 다음에 올린다. 단독으로는 서버·GUI 계약을 동시에 바꾸므로 바닥부터 순서 머지가 안전하다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun changed the base branch from codex/t4-03-antigravity-81a8 to dev September 6, 2026 18:24
@lidge-jun
lidge-jun marked this pull request as ready for review September 6, 2026 18:26
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 6, 2026 18:26
@lidge-jun
lidge-jun merged commit 57211f4 into dev Sep 6, 2026
35 of 55 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T18:27:56.181961Z cb84ad8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun deleted the codex/t4-04-log-polling-81a8 branch September 6, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant