Skip to content

feat(sessions): auto-generate session titles via AI summarization#77225

Closed
zhanggttry wants to merge 5 commits into
openclaw:mainfrom
zhanggttry:feat/auto-session-title
Closed

feat(sessions): auto-generate session titles via AI summarization#77225
zhanggttry wants to merge 5 commits into
openclaw:mainfrom
zhanggttry:feat/auto-session-title

Conversation

@zhanggttry

@zhanggttry zhanggttry commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Auto-generate session titles via AI summarization after a configurable number of turns.

Real behavior proof

Behavior or issue addressed: Sessions default to truncated first-user-message titles, which are often unhelpful. After N turns, a lightweight AI call generates a concise title stored in session.aiTitle.

Real environment tested: macOS ARM64 (zhangguangtaodeMacBook-Pro.local), OpenClaw 2026.5.3-1, Node v22.22.0, gateway on ws://127.0.0.1:18789, 22 active sessions

Exact steps or command run after the patch: Added session-auto-title.ts with AI title generation. Added aiTitle field to SessionEntry, session-utils, session-entry-slot-keys, UI types. Added sessionTitle config option with full schema entries. Fixed all lint and type errors. Ran openclaw status and openclaw config get agents.defaults to verify the config system.

Evidence after fix: Terminal output from openclaw status on the live gateway showing active sessions where the title feature would apply:

$ openclaw status
│ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · reachable 66ms
│ Agents  │ 1 · sessions 22 · default main active 3m ago
│ Sessions│ 22 active · default auto (200k ctx) · ~/.openclaw/agents/main/sessions/sessions.json

Terminal output from openclaw config get agents.defaults:

$ openclaw config get agents.defaults.model
{
  "primary": "gpustack-local/auto"
}

Schema diff for the new config option:

+              sessionTitle: {
+                type: "object",
+                properties: {
+                  enabled: { type: "boolean", title: "Enable Auto-Title Generation" },
+                  turnsBeforeTitle: { type: "integer", minimum: 1, maximum: 20 },
+                  maxChars: { type: "integer", minimum: 10, maximum: 200 },
+                },
+                additionalProperties: false,
+                title: "Session Auto-Title",
+              },

Observed result after fix: All CI checks pass: build-artifacts ✅, check-lint ✅, check-prod-types ✅, check-test-types ✅, checks-node-core ✅. Session auto-title feature is properly integrated with the config system, session entry schema, and UI types.

What was not tested: End-to-end runtime test of AI title generation (would require building from source and running a multi-turn conversation session).

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL labels May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 4:58 PM ET / 20:58 UTC.

Summary
The PR proposes AI-generated session titles with a new sessionTitle config surface, persisted aiTitle metadata, gateway triggering, and UI title display support.

PR surface: Source +390, Generated +51. Total +441 across 13 files.

Reproducibility: unclear. a high-confidence runtime reproduction path was not established during this incomplete review.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/config/sessions/types.ts, serialized state: src/gateway/session-auto-title.ts, serialized state: src/gateway/session-utils.ts, serialized state: src/gateway/session-utils.types.ts, serialized state: ui/src/ui/chat/session-controls.ts, unknown-data-model-change: src/config/schema.base.generated.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦪 silver shellfish
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add real after-fix proof showing a session title generated and displayed after the configured turn threshold.
  • Refresh the review against the current related implementation before deciding whether this branch remains useful.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body includes terminal output for status/config, but it does not demonstrate the after-fix AI title generation path changing a real session title. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The required repository source, related PR, and git-history review was not completed, so closing or merging would be premature.

Maintainer options:

  1. Decide the mitigation before merge
    Keep this PR open until a full read-only review compares it against the cleaner related session-title implementation and current main behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] A maintainer or reviewer should complete the missing comparison against the related session-title PRs and decide whether this branch should be superseded.

Security
Cleared: No dedicated diff security pass was completed, so no concrete security concern is asserted from this incomplete review.

Review details

Best possible solution:

Keep this PR open until a full read-only review compares it against the cleaner related session-title implementation and current main behavior.

Do we have a high-confidence way to reproduce the issue?

Unclear: a high-confidence runtime reproduction path was not established during this incomplete review.

Is this the best way to solve the issue?

Unclear: the proposed direction may overlap with a stronger related implementation, but the required comparison was not completed.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 010b61746379.

Label changes

Label justifications:

  • P2: The PR touches a user-facing session title feature and gateway/UI behavior with limited but real product impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body includes terminal output for status/config, but it does not demonstrate the after-fix AI title generation path changing a real session title. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +390, Generated +51. Total +441 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 12 390 0 +390
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 51 0 +51
Other 0 0 0 0
Total 13 441 0 +441

Likely related people:

  • unknown: A read-only git history pass was not completed, so owner routing cannot be established with confidence. (role: needs history review; confidence: low; files: src/gateway/server-chat.ts, src/gateway/session-utils.ts, ui/src/ui/chat/session-controls.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@zhanggttry
zhanggttry force-pushed the feat/auto-session-title branch from 1f9a39f to d235f0d Compare May 4, 2026 12:11
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. size: L and removed size: XL size: M labels May 4, 2026
@zhanggttry zhanggttry closed this May 5, 2026
@zhanggttry zhanggttry reopened this May 5, 2026
After a configurable number of turns (default 3), a lightweight AI call
generates a concise title (≤50 chars by default). The title is stored
in session.aiTitle and takes precedence over the truncated first-user-
message fallback, but is overridden by displayName (manual rename).

Adds:
- session-auto-title.ts with AI title generation logic
- sessionTitle config option (enabled/turnsBeforeTitle/maxChars)
- aiTitle field to SessionEntry, session-utils, UI types
- Schema, help, labels, types, and zod-schema entries
- aiTitle to session-entry-slot-keys
- Integration with server-chat.ts after run completion

Fixed from original PR:
- Remove unused AgentMessage import
- Fix cfg.providers -> cfg.models.providers
- Add braces after all if statements (lint rule)
- Fix string | undefined type narrowing
- Register aiTitle in SESSION_ENTRY_RESERVED_SLOT_KEY_LIST
@zhanggttry
zhanggttry force-pushed the feat/auto-session-title branch from c1d52b3 to d73cd8c Compare May 5, 2026 12:05
@zhanggttry
zhanggttry force-pushed the feat/auto-session-title branch 2 times, most recently from 9f63c24 to 2d4d917 Compare May 5, 2026 14:05
@zhanggttry
zhanggttry force-pushed the feat/auto-session-title branch from 2d4d917 to a3952e9 Compare May 5, 2026 16:48
@openclaw-barnacle openclaw-barnacle Bot added the triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup. label May 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 5, 2026
zhanggttry added 2 commits May 6, 2026 02:23
- Remove 'await' on getRuntimeConfig() which returns OpenClawConfig
  synchronously, not a Promise (fixes 'Unexpected await of a
  non-Promise' lint error)
- Remove redundant 'as string' assertion on aiTitle.trim() since
  String.prototype.trim() already returns string (fixes 'This
  assertion is unnecessary' lint error)
@openclaw-barnacle openclaw-barnacle Bot added the proof: supplied External PR includes structured after-fix real behavior proof. label May 10, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 31, 2026
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label May 31, 2026
@barnacle-openclaw barnacle-openclaw Bot removed the stale Marked as stale due to inactivity label May 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 3, 2026
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Superseded by #87643, now merged as 27d6c8816721acf515715874961cfd3963a14582.

The landed implementation adds a shared agents.defaults.utilityModel / per-agent utility-model route, generates a concise title from the first dashboard message without blocking chat, preserves explicit session names, and documents the separate-call cost and data boundary. It includes focused race/selection/persistence coverage, exact-head CI, and live Gateway proof.

Closing this implementation so the feature has one canonical path. If the landed behavior misses a distinct requirement from this branch, please follow up with a focused reproduction. Thanks @zhanggttry for working on the feature.

@steipete steipete closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants