Skip to content

feat(agents): Add session auto-title#2185

Merged
topher-lo merged 4 commits intomainfrom
codex/review-autotitle-plan
Feb 25, 2026
Merged

feat(agents): Add session auto-title#2185
topher-lo merged 4 commits intomainfrom
codex/review-autotitle-plan

Conversation

@topher-lo
Copy link
Contributor

@topher-lo topher-lo commented Feb 25, 2026

Screenshot 2026-02-25 at 1 59 25 PM

Summary

  • document remaining auto-title work in docs/session-auto-title-todos.md
  • plumb initial prompt through session creation/workflow startup for auto-titling (CreateSessionInput, durable workflow args)
  • add generation service + tests for auto-titling with credential sandbox + logging and guard behavior

Testing

  • Not run (not requested)

Summary by cubic

Auto-generate session titles from the first user prompt for all session types, including workflow-created sessions. Titles use a service-scoped model config with safe credentials, structured logs, and duplicate guards; the sidebar now truncates long titles to prevent overflow.

  • New Features

    • Auto-title on first prompt for all session types; invoked in run_turn and create_session_activity when initial_user_prompt is present.
    • Title generator with sanitization (≤8 words, ≤60 chars), plain text only, and 8s timeout.
    • Durable workflows pass the user's prompt into CreateSessionInput.initial_user_prompt.
    • Sidebar truncates long session titles to avoid overflow.
  • Refactors

    • Title generation runs under a service-scoped role (tracecat-api) with correct scopes; model config exposes credentials to both registry and env contexts.
    • Compare-and-set and duplicate-call guards prevent overwriting seeded titles or re-triggering after history.
    • Structured logs for attempt, skip, success, failure; narrowed error handling to expected domain errors.
    • Tests verify service-scoped execution, duplicate-call skip, title generator behavior, and credential context.

Written for commit 85e5199. Summary will update on new commits.

@topher-lo topher-lo changed the title Add session auto-title when workflows start feat(api): Add session auto-title when workflows start Feb 25, 2026
@topher-lo topher-lo added the agents LLM agents label Feb 25, 2026
@topher-lo topher-lo changed the title feat(api): Add session auto-title when workflows start feat(agents): Add session auto-title when workflows start Feb 25, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 618cd18487

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tracecat/agent/session/title_generator.py">

<violation number="1" location="tracecat/agent/session/title_generator.py:83">
P2: Avoid catching `Exception` in business logic; handle only expected failures (e.g., timeouts) and let unexpected errors surface to the centralized handler for consistent logging/sanitization.

(Based on your team's feedback about avoiding broad exception handling in business logic.) [FEEDBACK_USED]</violation>
</file>

<file name="tracecat/agent/session/service.py">

<violation number="1" location="tracecat/agent/session/service.py:523">
P2: Avoid broad `except Exception` in the service layer; it swallows unexpected failures that should be surfaced via the normal exception translation path. Handle only expected/domain errors (and let unexpected errors propagate to the router/global handler).

(Based on your team's feedback about error handling posture.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@topher-lo topher-lo changed the title feat(agents): Add session auto-title when workflows start feat(agents): Add session auto-title Feb 25, 2026
@topher-lo topher-lo merged commit b98b35b into main Feb 25, 2026
13 of 18 checks passed
@topher-lo topher-lo deleted the codex/review-autotitle-plan branch February 25, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents LLM agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant