Skip to content

Smart Title fails with response.headers TypeError; title never updates #6

@ndrwstn

Description

@ndrwstn

Hi — I’m hitting a consistent crash in Smart Title. The plugin initializes and sees idle events, but title generation fails every time with a response.headers TypeError, so the session title never updates.

Versions

  • @tarquinen/opencode-smart-title@0.1.7
  • @tarquinen/opencode-auth-provider@0.1.7
  • OpenCode config uses github-copilot/gpt-5-mini

What I see

  • Title stays at default (# New session – )
  • Debug log shows idle triggers, model selection succeeds, then hard error during title generation.

Log excerpt

INFO  Smart Title plugin initialized
DEBUG Session became idle
INFO  Threshold reached, triggering title update
INFO  Model selected (github-copilot/gpt-5-mini)
ERROR Failed to generate title
TypeError: undefined is not an object (evaluating 'response.headers')
  at extractResponseHeaders .../@ai-sdk/provider-utils/dist/index.mjs:129:33

Notes / hypothesis
It looks like the auth-provider’s custom fetch wrapper is returning undefined on auth/refresh failure (or a non-throwing fetch failure). The AI SDK then tries to read response.headers and crashes. The model selection step succeeds, so this doesn’t look like a config issue.

Expected

  • If fetch fails, throw a clean error so the SDK doesn’t attempt to read headers on undefined.
  • Smart Title should log a useful error and skip updating the title instead of crashing.

Repro

  1. Enable Smart Title debug logging.
  2. Start a session and wait for it to go idle.
  3. Observe the response.headers TypeError in the log and no title update.

If you want more log lines or a full debug file, I can provide it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions