Skip to content

[5580] fix(frontend): Skip the sessions query on the onboarding view - #5582

Open
mmabrouk wants to merge 1 commit into
release/v0.106.1from
fix/onboarding-sessions-query-422
Open

[5580] fix(frontend): Skip the sessions query on the onboarding view#5582
mmabrouk wants to merge 1 commit into
release/v0.106.1from
fix/onboarding-sessions-query-422

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

Every fresh landing on the playground onboarding view produced a failing POST /sessions/query request: the view uses the synthetic reference id onboarding, which is not a UUID, so the API answered 422 and the console logged an error. The query also refetched on window focus and on a 60s interval, so the noise repeated for as long as the tab stayed open.

Before: landing on the onboarding view fires /sessions/query with "onboarding" as the reference id, gets a 422, and logs a console error on every landing, focus, and 60s refetch.

After: the query never fires during onboarding. No request, no 422, no console error. With a real agent selected, behavior is unchanged.

How it works

projectSessions.ts already gates the sessions query with isQueryableScope, which excludes the non-agent scope keys (__global__ and drawer:*) so TanStack Query's enabled stays false for them. This change adds ONBOARDING_SCOPE_KEY to that same gate. When a real agent is selected, the scope key is the app UUID, so the gate passes and the query behaves exactly as before.

Closes #5580

https://claude.ai/code/session_01Qitvc9dCiunLishsJYRzbp

The playground onboarding view fired POST /sessions/query with the synthetic reference id "onboarding", which is not a UUID, so the API answered 422 and the console logged an error on every landing. Add ONBOARDING_SCOPE_KEY to the existing isQueryableScope gate so TanStack Query stays disabled during onboarding. With a real agent selected the scope key is the app UUID and the query behaves exactly as before.

Claude-Session: https://claude.ai/code/session_01Qitvc9dCiunLishsJYRzbp
@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. Frontend labels Jul 30, 2026
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Jul 30, 2026 2:37pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c95a5650-6d51-4eae-88d3-5720bbe303bd

📥 Commits

Reviewing files that changed from the base of the PR and between 9ac0c55 and 367403b.

📒 Files selected for processing (1)
  • web/oss/src/components/AgentChatSlice/state/projectSessions.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Prevented session queries from running in the onboarding scope.
    • Improved handling of non-agent scopes to avoid displaying irrelevant session data during onboarding.

Walkthrough

The session list query is disabled when the active application scope is the onboarding scope, preventing queries for the synthetic onboarding reference.

Changes

Onboarding query guard

Layer / File(s) Summary
Exclude onboarding scope from session queries
web/oss/src/components/AgentChatSlice/state/projectSessions.ts
isQueryableScope now excludes ONBOARDING_SCOPE_KEY in addition to global and drawer scopes.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related issues

  • #5559 — Excludes the "onboarding" scope from session queries, preventing recurring invalid requests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main fix: skipping the sessions query on the onboarding view.
Description check ✅ Passed The description matches the change and explains the onboarding query guard and its effect.
Linked Issues check ✅ Passed The change adds the onboarding scope to the existing query gate, meeting issue #5580's requirement.
Out of Scope Changes check ✅ Passed No unrelated code changes are apparent beyond the onboarding sessions-query guard.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/onboarding-sessions-query-422

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.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-f569.up.railway.app/w
Project agenta-oss-pr-5582
Image tag pr-5582-ad6074e
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-07-30T17:58:59.220Z

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

Labels

Frontend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant