Skip to content

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

Merged
charlesvien merged 8 commits intomainfrom
04-01-replace_preview_session_process_spawn_with_lightweight_config_query
Apr 2, 2026
Merged

feat: Replace preview session process spawn with lightweight config query#1438
charlesvien merged 8 commits intomainfrom
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

@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 🫡

@jonathanlab jonathanlab force-pushed the 04-01-model-selector-broken branch from 5f29f86 to ff2787d Compare April 2, 2026 11:23
@jonathanlab jonathanlab force-pushed the 04-01-replace_preview_session_process_spawn_with_lightweight_config_query branch from 12024f5 to e2a1a17 Compare April 2, 2026 11:27
Copy link
Copy Markdown
Contributor

jonathanlab commented Apr 2, 2026

Merge activity

Base automatically changed from 04-01-model-selector-broken to main April 2, 2026 14:05
@charlesvien charlesvien merged commit c532d71 into main Apr 2, 2026
11 checks passed
@charlesvien charlesvien deleted the 04-01-replace_preview_session_process_spawn_with_lightweight_config_query branch April 2, 2026 16:20
charlesvien added a commit that referenced this pull request Apr 2, 2026
## Problem

Removing the preview session in #1438 broke slash command suggestions in the new task view -- only the 3 built-in feedback commands appear when typing /.

## Changes

  1. Fetch skills from skills.list on TaskInputEditor mount and store in draftStore.commands
  2. Fall back to draftStore.commands in getCommandSuggestions when no active session exists
  3. Clean up stored commands on unmount

## How did you test this?

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

Labels

None yet

Projects

None yet

3 participants