Repository navigation
Add logs tail and logs list for project request logs - #73
Conversation
|
Warning Review limit reachedThe included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 22 minutes. View limit details
Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2cfebb03c
ℹ️ 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".
| this.writeValue( | ||
| { | ||
| data: page.items, | ||
| page: { | ||
| nextCursor: page.nextCursor, |
There was a problem hiding this comment.
Return list JSON in the standard read envelope
When logs list --json succeeds, this hand-built value contains only data and page, omitting the standard schemaVersion, context, and request fields—including the response request ID, status, and API version. Comparable developer list commands use developerRead/readEnvelope, so consumers cannot process request-log results through the established read-output contract. Preserve the response metadata from listRequestLogs and build the standard envelope while retaining followCursor in the page data.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 49c53ad. logs list --json now uses developerRead, giving schemaVersion, context, request (ID, status, API version) and page, with followCursor kept in page. Test: prints list JSON in the standard read envelope with the follow cursor.
| const seconds = Number(error.metadata?.headers['retry-after']) | ||
| const waitMs = Math.min( | ||
| Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : 60_000, |
There was a problem hiding this comment.
Honor all valid Retry-After values
When a rate-limit response supplies Retry-After: 0 or an HTTP-date, this conversion either rejects the valid zero delay or produces NaN, causing an arbitrary 60-second wait instead of the server-requested delay. The repository's other Retry-After parsers accept nonnegative delta-seconds and HTTP-dates; use equivalent parsing here so logs tail does not resume too early or unnecessarily stall.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 49c53ad. The tail loop now uses the CLI's existing retryAfter parser (delta-seconds including 0, or an HTTP-date), and falls back to 60 s only when the header is missing or invalid. Test: retries at once on Retry-After: 0.
Summary
Adds
polymorfa logs tailandpolymorfa logs list, the CLI side of the project request log (polymorfa/polymorfa#549). It works likestripe logs tail.logs tail:--backfill, default 10).--poll-intervalseconds (default 2, 1 to 60), and reads again at once while more are waiting.Retry-Afterwhen the 120-reads-a-minute limit is reached.--jsonwrites one JSON line per request;--max-eventsstops after a fixed number.logs listprints one newest-first page with a--cursorfor older requests.Both accept
--status(codes or classes),--method,--route,--source,--credential,--request-idand--trace-id.Impact
Impact table
logs tailandlogs list, thelogstopic, and a filter helper. CallsGET /platform/projects/{projectId}/request-logsthrough the SDK raw client with zod validation, likebillingcontrolssrc/commands/logs/*,src/services/request-logs.ts,src/input/request-log-filters.ts,package.jsonREADME.mdf97fb511); the commands return data once it is deployed, and 404 before thatclient.requestLogsarrives in polymorfa/sdks#342. This PR keeps the pinned SDK and can switch to the typed method after an accepted nightlypolymorfa/polymorfadocs/follow once packages publishNo impact table
--project, or a project tokensrc/developer/client.tsunchangedrequest_log_listin the API PRVerification
At
ddffd33onmain43e55a4:npm run verifypassed: format, lint, typecheck, 109 files and 1,032 tests, build,npm pack --dry-run, and an audit with 0 vulnerabilities.test/commands/request-logs.test.ts, 5 tests, covers:--cursorcombined with filters being refused before any request;Retry-After;createAppwith a real Postgres. It printed a request made before it started, then one made during polling, with the caller's trace IDs. Details are in polymorfa/polymorfa#549.Review round: fixed both Codex findings:
logs list --jsonuses the standarddeveloperReadenvelope, andRetry-Afteris parsed with the CLI's shared parser.npm run verifypasses (1,034 tests), and CI is green on the final head.Session provenance and UI evidence
internal/agent-sessions/sessions/purpshell-t3-claude/request-logs-tail/5a462ed1e620c3ff445ab1a150fc9cfb2154f8a1ee50f22a870e3f5926d221b1.mdin polymorfa/polymorfa, evidence commit750f5a519.Rollout and rollback
Merge order: after polymorfa/polymorfa#549, which is merged.
Availability: follows the next accepted CLI nightly and the API deployment.
Rollback: revert. The commands are additive.