Skip to content

feat(dashboard): show account plan in request logs table#425

Open
stemirkhan wants to merge 3 commits intoSoju06:mainfrom
stemirkhan:feat/request-logs-plan-type
Open

feat(dashboard): show account plan in request logs table#425
stemirkhan wants to merge 3 commits intoSoju06:mainfrom
stemirkhan:feat/request-logs-plan-type

Conversation

@stemirkhan
Copy link
Copy Markdown

@stemirkhan stemirkhan commented Apr 16, 2026

Summary

  • persist a nullable plan_type snapshot on request_logs when a request log row is written
  • expose the persisted planType on GET /api/request-logs and show it in the dashboard recent request logs table
  • keep legacy request-log rows renderable by leaving pre-existing rows with planType: null

Screenshot

Request logs plan column

Testing

  • /home/temirkhan/codex-lb-my/codex-lb-upstream/.venv/bin/python -m pytest tests/integration/test_request_logs_filters.py tests/integration/test_request_logs_list_count.py tests/integration/test_migrations.py -q
  • cd frontend && npx -y node@20 ./node_modules/vitest/vitest.mjs run src/features/dashboard/components/recent-requests-table.test.tsx src/features/dashboard/schemas.test.ts
  • openspec validate --specs

Notes

@stemirkhan
Copy link
Copy Markdown
Author

stemirkhan commented Apr 16, 2026

Ready for review. This now persists a nullable plan_type snapshot onto request_logs, so the dashboard shows the historical account plan for each row instead of joining against the current account state. I also updated the PR body screenshot/testing details to match the migration-based approach.

@stemirkhan stemirkhan marked this pull request as ready for review April 16, 2026 19:03
@huzky-v
Copy link
Copy Markdown
Collaborator

huzky-v commented Apr 17, 2026

Just curious that if a user account plan is changed, the account type in the history will be wrong as the joining is for the current account type, not for the account type requested at that moment.

E.g. When the request is at free account type, but get upgraded to plus after the request, it may show plus, which i think is not showing the correct history in this case.

I still think persisting the account type (aka table change w/ migration) is necessary in this case

@stemirkhan
Copy link
Copy Markdown
Author

Thanks, that concern was correct. I reworked this in 62a6c55 to persist a nullable plan_type snapshot on request_logs with a migration, and the API/UI now read the persisted value instead of the current Account.plan_type.

I also added regression coverage for the history case: a log written while the account is free still returns planType: "free" after the account is later updated to team. Legacy rows created before the migration remain null intentionally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants