Skip to content

feat: add dynamic window titles based on user messages#475

Closed
aryasaatvik wants to merge 29 commits into
anomalyco:devfrom
AryaLabsHQ:feat/dynamic-window-title-coder
Closed

feat: add dynamic window titles based on user messages#475
aryasaatvik wants to merge 29 commits into
anomalyco:devfrom
AryaLabsHQ:feat/dynamic-window-title-coder

Conversation

@aryasaatvik

Copy link
Copy Markdown
Contributor

Summary

  • Adds dynamic window title generation that shows the user's message in the terminal title bar while AI is processing
  • Implements AI-powered title generation using fast models (Haiku for Anthropic, GPT-4o-mini for OpenAI)
  • Window title reverts to "opencode" when AI finishes processing or when session is interrupted

Implementation Details

  • Added /session_generate_title endpoint in TypeScript server
  • Created title-window.txt prompt file for concise title generation
  • Integrated window title updates in Go TUI client
  • Title generation happens asynchronously without blocking message submission
  • Handles edge cases like session interruption, session switching, and model selection

Test Plan

  • Test window title updates when submitting messages
  • Verify title reverts to "opencode" when AI completes
  • Test title reset on session interrupt (Ctrl+C)
  • Verify title resets when switching sessions
  • Test fallback to truncated message if API fails
  • Ensure title generation works with different providers (Anthropic, OpenAI)
CleanShot.2025-06-21.at.01.54.50.mp4

- Implement formatWindowTitle function to set dynamic window titles based on submitted messages
- Update window title on message send and reset when processing is complete
- Maintain lastSubmittedMessage and wasProcessing state for accurate title updates
- Implement /session_generate_title endpoint to generate concise titles for messages
- Add generateTitle function in Session namespace to handle title generation logic
- Introduce windowTitle function in SystemPrompt to retrieve the title prompt from a new file
- Introduce PostSessionGenerateTitleJSONBody for request parameters
- Implement PostSessionGenerateTitle and PostSessionGenerateTitleWithBody methods in the client
- Add response parsing for PostSessionGenerateTitleResponse
- Update OpenAPI spec to include /session_generate_title endpoint with request and response schemas
- Add WindowTitleMsg type for window title updates
- Introduce GenerateWindowTitle method to handle title generation logic
- Update app model to asynchronously set window title based on generated titles
## Summary
This PR implements dual model support (main + turbo) for cost-optimized
operations and adds model sorting functionality.

### Key Changes

#### Dual Model Support
- Added `turbo_model` and `turbo_cost_threshold` config options
- New dual-pane model selector (Tab to switch panes)
- Visual indicators: ⚡ (turbo), 🧠 (reasoning), 🔧 (tools)
- Smart turbo model selection with fallback logic
- Fixed Anthropic auth showing incorrect turbo status

#### Model Sorting
- Added `release_date` and `last_updated` fields to model schema
- Press 'S' to cycle through sort modes: Name, Last Updated, Release
Date
- Stable multi-level sorting with consistent ordering
- Helps discover newest models and track updates

### Impact
Enables cost optimization for PRs anomalyco#269 (status verbs) and anomalyco#275 (window
titles) to use configured turbo models instead of hardcoded ones.

### Demo



https://github.com/user-attachments/assets/d076e840-d790-4e23-8cf7-a179282d1f0b
- Commented out the installation of makepkg and SSH setup for AUR in the GitHub Actions workflow.
- Updated repository references in the publish script from 'sst' to 'AryaLabsHQ'.
- Commented out SHA calculation and AUR package build sections in the publish script for future reference.
…lated files

- Updated package names and references from 'opencode' to 'opencoder' across all relevant files.
- Modified installation script and binary names to reflect the new project name.
- Adjusted GitHub Actions workflow for publishing to use the new repository name.
- Added '.opencoder' to .gitignore to exclude new project-specific files.
## Summary
- Added dynamic verb generation API for status messages
- Implemented verb history and cycling in app state
- Integrated dynamic verb generation in the editor
- Generated OpenAPI spec and client

## Test plan
- [x] Test verb generation API endpoint
- [x] Verify verb cycling functionality works correctly
- [x] Ensure editor properly displays dynamic verbs
- [x] Check OpenAPI spec is correctly generated


https://github.com/user-attachments/assets/9e0c271d-1f2d-467a-bdfa-f2cb9332fe25
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
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.

1 participant