Skip to content

feat: Replace preview session process spawn with lightweight config query#1438

Open
charlesvien wants to merge 5 commits into04-01-model-selector-brokenfrom
04-01-replace_preview_session_process_spawn_with_lightweight_config_query
Open

feat: Replace preview session process spawn with lightweight config query#1438
charlesvien wants to merge 5 commits into04-01-model-selector-brokenfrom
04-01-replace_preview_session_process_spawn_with_lightweight_config_query

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Apr 2, 2026

Problem

Creating a new task required spawning a full preview session just to fetch model/mode config options, adding too much latency + complexity.

I don't get the value of these anymore, if someone else does please let me know if I am way off here. We added preview sessions at a time before the gateway had a models API endpoint and before a ton of infrastructure we now have.

The worst part is the preview sessions don't help prompt submit -> agent working time because they are only used to fetch model and mode config options. It's not used as the session for the actual task on prompt submission and tbh that's probably for the best.

Closes #1347
Closes #1363

Changes

  1. Add getPreviewConfigOptions method to AgentService that fetches config without spawning a session
  2. Replace usePreviewSession hook with usePreviewConfig hook using a simple tRPC query
  3. Remove preview session service infrastructure
  4. Update TaskInputEditor and TutorialStep to pass config options as props instead of relying on session state
  5. Refactor ReasoningLevelSelector and UnifiedModelSelector to accept options via props
  6. Export additional gateway model helpers from agent package

How did you test this?

Manually

Copy link
Copy Markdown
Member Author

charlesvien commented Apr 2, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@charlesvien charlesvien changed the title Replace preview session process spawn with lightweight config query feat: Replace preview session process spawn with lightweight config query Apr 2, 2026
@charlesvien charlesvien marked this pull request as ready for review April 2, 2026 04:13
Copy link
Copy Markdown
Contributor

@adboio adboio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zero context on the history of the preview session but this seems reasonable, good stuff 🫡

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