[PR #475] [CLOSED] feat: add dynamic window titles based on user messages #9622

Closed
opened 2026-02-16 18:13:52 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/475
Author: @aryasaatvik
Created: 6/27/2025
Status: Closed

Base: devHead: feat/dynamic-window-title-coder


📝 Commits (10+)

  • 5f95fc5 feat: enhance window title management in app
  • 9ccd1fc feat: add session title generation API
  • 9cb1ee4 feat: add PostSessionGenerateTitle API and response handling
  • 1b5d653 feat: implement window title generation in app
  • ae32429 feat: dual model support and sorting by release date (#1)
  • fc2efdb chore: update publish workflow and change repository references
  • ca70403 refactor: rename project from 'opencode' to 'opencoder' and update related files
  • 797370d fix: update output path in publish script to reflect project name change
  • 4845db2 fix: update git config and working directory in publish workflow to reflect project name change
  • 3b030da chore: comment out branch triggers in deploy workflow for future reference

📊 Changes

80 files changed (+17299 additions, -876 deletions)

View changed files

📝 .github/workflows/deploy.yml (+4 -4)
📝 .github/workflows/publish.yml (+17 -14)
📝 .gitignore (+2 -0)
📝 bun.lock (+192 -75)
infra/app.ts (+0 -41)
📝 install (+12 -12)
📝 package.json (+2 -2)
📝 packages/function/package.json (+12 -2)
📝 packages/function/src/api.ts (+9 -11)
packages/function/sst-env.d.ts (+0 -25)
📝 packages/function/tsconfig.json (+44 -7)
packages/function/worker-configuration.d.ts (+7340 -0)
packages/function/wrangler.jsonc (+45 -0)
📝 packages/opencode/bin/opencode (+2 -2)
📝 packages/opencode/package.json (+2 -2)
📝 packages/opencode/script/postinstall.mjs (+5 -5)
📝 packages/opencode/script/publish.ts (+114 -114)
📝 packages/opencode/src/cli/cmd/run.ts (+1 -1)
📝 packages/opencode/src/cli/ui.ts (+3 -3)
📝 packages/opencode/src/config/config.ts (+10 -1)

...and 60 more files

📄 Description

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)

https://github.com/user-attachments/assets/32d3f521-70db-42f4-b129-71dab67be3fe


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/475 **Author:** [@aryasaatvik](https://github.com/aryasaatvik) **Created:** 6/27/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat/dynamic-window-title-coder` --- ### 📝 Commits (10+) - [`5f95fc5`](https://github.com/anomalyco/opencode/commit/5f95fc5b15ae72b2e90cf36dad94a550fa93dece) feat: enhance window title management in app - [`9ccd1fc`](https://github.com/anomalyco/opencode/commit/9ccd1fc466211b9d31e37aa197120d8ce01fad92) feat: add session title generation API - [`9cb1ee4`](https://github.com/anomalyco/opencode/commit/9cb1ee4a206b3c5e05a0c845bc67868d5f4b4081) feat: add PostSessionGenerateTitle API and response handling - [`1b5d653`](https://github.com/anomalyco/opencode/commit/1b5d653982b4ac7a442e7915ef4443ff13525a7f) feat: implement window title generation in app - [`ae32429`](https://github.com/anomalyco/opencode/commit/ae32429c344785f15a88ec3cba63d75a1398cc0c) feat: dual model support and sorting by release date (#1) - [`fc2efdb`](https://github.com/anomalyco/opencode/commit/fc2efdb05d8bae12c776557363bc28aacda8da87) chore: update publish workflow and change repository references - [`ca70403`](https://github.com/anomalyco/opencode/commit/ca70403416210aed13f59764d99491f2e5dc7f62) refactor: rename project from 'opencode' to 'opencoder' and update related files - [`797370d`](https://github.com/anomalyco/opencode/commit/797370da1b4a24c1d589772127f1ab1d8ca8f4e6) fix: update output path in publish script to reflect project name change - [`4845db2`](https://github.com/anomalyco/opencode/commit/4845db2f583defe7598612cd2ea1d00e17b38edd) fix: update git config and working directory in publish workflow to reflect project name change - [`3b030da`](https://github.com/anomalyco/opencode/commit/3b030daa32de1c95e5f6ad045e92c26309ba237a) chore: comment out branch triggers in deploy workflow for future reference ### 📊 Changes **80 files changed** (+17299 additions, -876 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/deploy.yml` (+4 -4) 📝 `.github/workflows/publish.yml` (+17 -14) 📝 `.gitignore` (+2 -0) 📝 `bun.lock` (+192 -75) ➖ `infra/app.ts` (+0 -41) 📝 `install` (+12 -12) 📝 `package.json` (+2 -2) 📝 `packages/function/package.json` (+12 -2) 📝 `packages/function/src/api.ts` (+9 -11) ➖ `packages/function/sst-env.d.ts` (+0 -25) 📝 `packages/function/tsconfig.json` (+44 -7) ➕ `packages/function/worker-configuration.d.ts` (+7340 -0) ➕ `packages/function/wrangler.jsonc` (+45 -0) 📝 `packages/opencode/bin/opencode` (+2 -2) 📝 `packages/opencode/package.json` (+2 -2) 📝 `packages/opencode/script/postinstall.mjs` (+5 -5) 📝 `packages/opencode/script/publish.ts` (+114 -114) 📝 `packages/opencode/src/cli/cmd/run.ts` (+1 -1) 📝 `packages/opencode/src/cli/ui.ts` (+3 -3) 📝 `packages/opencode/src/config/config.ts` (+10 -1) _...and 60 more files_ </details> ### 📄 Description ## 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 - [x] Test window title updates when submitting messages - [x] Verify title reverts to "opencode" when AI completes - [x] Test title reset on session interrupt (Ctrl+C) - [x] Verify title resets when switching sessions - [x] Test fallback to truncated message if API fails - [x] Ensure title generation works with different providers (Anthropic, OpenAI) https://github.com/user-attachments/assets/32d3f521-70db-42f4-b129-71dab67be3fe --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:52 -05:00
yindo closed this issue 2026-02-16 18:13:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9622