Add token-protected dashboard snapshots to the CLI server#1026
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08a598e122
ℹ️ 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".
| staleAfterSeconds: max(180, Int(refreshInterval.rounded(.up)) * 3), | ||
| host: DashboardHostPayload( | ||
| codexBarVersion: codexBarVersion, | ||
| refreshIntervalSeconds: max(0, Int(refreshInterval.rounded()))), |
There was a problem hiding this comment.
Reject huge refresh intervals before Int conversion
When a user passes a very large but finite --refresh-interval (for example 1e300), decodeServeRefreshInterval accepts it, but the first dashboard snapshot converts it with Int(refreshInterval.rounded(...)); Swift traps on out-of-range Double to Int conversion, killing the server instead of reporting an argument error. Clamp or reject values above the representable range before these conversions.
Useful? React with 👍 / 👎.
c914abe to
e3165ac
Compare
e3165ac to
babb10f
Compare
Summary
codexbar servewith a token-protected dashboard snapshot endpoint.none: omit account identity fieldsredacted: redact sensitive identity values while preserving useful account context such as domains/plansfull: include full identity values for trusted local/private deploymentsRationale
Implementation notes
Commands run
swift testmake checkswiftformat Sources Tests --lintswiftlint --strictgit diff --check upstream/main...HEADScreenshots/GIFs
Reference
Contribution notes
CONTRIBUTING.mdor pull request template was found.AGENTS.md.mainatd715648c.docs: add dashboard snapshot API referencefeat(cli): add dashboard snapshot payload builderfeat(cli): serve token-protected dashboard snapshots