Enable AI chat to create new workspace tabs (for example, styles tabs) and support cross-tab workflows where the user references a different tab than the active one.
Problem
Current AI chat flow can update existing tabs via propose_editor_update, but it cannot create tabs.
Requests like “add a new styles tab that colors paragraphs from src/components/status.tsx” are not fully satisfiable unless the target source tab is active or manually pasted into chat.
Goals
- Add create_workspace_tab tool support in chat.
- Keep propose_editor_update focused on updating existing tab content.
- Preserve existing payload size/summarization protections.
- Keep behavior mode-aware (DOM/React and style dialect policies already in place).
Non-goals
- Multi-tab creation in one call.
- Automatic framework/style dialect conversion.
- Reworking existing workspace tab architecture.
Proposed Tool Contract
Tool name: create_workspace_tab
Parameters
- path (string, required): normalized workspace-relative path for new tab.
- language (string, required): tab language/dialect (for example javascript-jsx, css, less, sass, module).
- initialContent (string, optional): initial source content.
- activate (boolean, optional): whether to switch to new tab immediately.
Validation rules
- Reject duplicate path collisions.
- Normalize path consistently with existing tab helpers.
- Reject unsupported/empty language values.
- Return created tab id, name, path, language.
Follow-up for cross-tab context
Implement one of:
- Send all tabs option in chat drawer, or
- read_workspace_tab tool (id/path based) so model can pull source tab content explicitly.
Acceptance Criteria
- AI can create a new styles tab through chat using create_workspace_tab.
- Created tab appears in workspace tabs UI and persists via workspace save flow.
- Existing propose_editor_update still updates by tab id/path.
- No regression in chat payload byte budget and summarization behavior.
- DOM mode guidance and style dialect guidance remain intact in system prompt context.
- Playwright coverage added for:
- Tool-call-driven tab creation success.
- Duplicate path rejection handling.
- Cross-tab request scenario with either Send all tabs or read_workspace_tab.
Suggested implementation touchpoints
- proposals.js
- drawer.js
- app.js
- github-workflows.js
- github-workflows-setup.js
- github-byot-ai.spec.ts
Risks / considerations
- Avoid ambiguous target/path behavior between create and update tools.
- Prevent invalid or unsafe paths.
- Keep tool semantics simple and explicit (create vs update split).
Enable AI chat to create new workspace tabs (for example, styles tabs) and support cross-tab workflows where the user references a different tab than the active one.
Problem
Current AI chat flow can update existing tabs via propose_editor_update, but it cannot create tabs.
Requests like “add a new styles tab that colors paragraphs from src/components/status.tsx” are not fully satisfiable unless the target source tab is active or manually pasted into chat.
Goals
Non-goals
Proposed Tool Contract
Tool name: create_workspace_tab
Parameters
Validation rules
Follow-up for cross-tab context
Implement one of:
Acceptance Criteria
Suggested implementation touchpoints
Risks / considerations