Skip to content

Add debug title command for session title generation#1622

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-title-generation
Feb 7, 2026
Merged

Add debug title command for session title generation#1622
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-title-generation

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 6, 2026

  • Add a 'cagent debug title ' command that generates a session title using the same sessiontitle.Generator code path as the TUI, making it easy to debug title generation behavior.
  • Fix title generation for openai 5* models
  • Fix title generation for gemini 3 pro

Assisted-By: cagent

Add a 'cagent debug title <agent-file> <question>' command that generates a session title using the same sessiontitle.Generator code path as the TUI, making it easy to debug title generation behavior.

Assisted-By: cagent
@dgageot dgageot requested a review from a team as a code owner February 6, 2026 13:19
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

No issues found in the changed code

This PR adds a new cagent debug title command and fixes title generation for OpenAI gpt-5* and Gemini 3 Pro models.

Changes Reviewed

  1. New debug title command (cmd/root/debug.go)

    • Proper error handling throughout
    • Cleanup function correctly implemented and deferred
    • Title output correctly uses fmt.Fprintln (title has no trailing newline)
  2. Test refactoring (e2e/)

    • Consolidated test helper functions
    • New comprehensive tests for title generation across providers
  3. Provider fixes

    • OpenAI: Correctly detects gpt-5* models for Responses API
    • Gemini: Properly handles Gemini 3's requirement for thinking (cannot fully disable)

Verification

All error paths are handled, resource cleanup is properly deferred, and the code follows Go best practices.

Great work! 🎉

ThinkingBudget: genai.Ptr(int32(0)),
model := strings.ToLower(c.ModelConfig.Model)
if strings.HasPrefix(model, "gemini-3-") {
// Gemini 3 models require thinking — they reject ThinkingBudget=0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google has been a pain in changing out their thinking works and needs to be configured 2-3 times already

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's why I started adding those tests

@dgageot dgageot merged commit 51a1a51 into docker:main Feb 7, 2026
13 of 14 checks passed
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.

2 participants