跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    hyakt

    Smart Title

    v0.1.10其他
    @hyakt/opencode-smart-title

    OpenCode plugin that automatically generates meaningful session titles using AI and smart context selection

    GitHub 星标

    0

    月装机量

    16

    近 7 天 7

    综合评分SCORE

    22.7

    生态多维模型

    最近提交

    3 个月前

    2026-05-18

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@hyakt/opencode-smart-title@0.1.10"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    Auto-generates meaningful session titles for your OpenCode conversations using AI.

    Forked from @tarquinen/opencode-smart-title.

    What Changed (Why This Fork)

    The original plugin uses @tarquinen/opencode-auth-provider + ai SDK to call LLM APIs directly from the plugin. This approach has a compatibility issue: the auth-provider's custom fetch wrapper returns undefined instead of a proper Response object when used with the github-copilot provider, causing extractResponseHeaders(response) to crash with TypeError: undefined is not an object.

    This fork replaces the direct API call with OpenCode's subagent session API (client.session.create / client.session.prompt), delegating LLM calls to OpenCode itself.

    Benefits

    • Works with all providers including github-copilot (no auth-provider fetch bug)
    • Removed 3 heavy dependencies: ai, @ai-sdk/openai-compatible, @tarquinen/opencode-auth-provider
    • Custom prompt support via prompt config field

    What It Does

    • Watches your conversation and generates short, descriptive titles
    • Updates automatically when the session becomes idle (you stop typing)
    • Delegates LLM calls to OpenCode via subagent sessions - no direct API calls
    • Works with any provider that OpenCode supports

    Installation

    Add to ~/.config/opencode/opencode.json:

    {
      "plugin": ["@hyakt/opencode-smart-title"]
    }
    

    Configuration

    The plugin supports both global and project-level configuration:

    • Global: ~/.config/opencode/smart-title.jsonc - Applies to all sessions
    • Project: .opencode/smart-title.jsonc - Overrides global config

    The plugin creates a default global config on first run.

    {
      // Enable or disable the plugin
      "enabled": true,
    
      // Enable debug logging
      "debug": false,
    
      // Optional: Use a specific model (format: "provider/model")
      // "model": "github-copilot/claude-haiku-4.5",
    
      // Optional: Custom prompt for title generation
      // "prompt": "Generate a short Japanese title for this conversation.",
    
      // Update title every N idle events (1 = every time you pause)
      "updateThreshold": 1
    }
    

    License

    MIT