feat(sessions): auto-generate session titles via AI summarization#77225
feat(sessions): auto-generate session titles via AI summarization#77225zhanggttry wants to merge 5 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 4:58 PM ET / 20:58 UTC. Summary 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 Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 changesLabel justifications:
Evidence reviewedPR surface: Source +390, Generated +51. Total +441 across 13 files. View PR surface stats
Likely related people:
What the crustacean ranks mean
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
|
1f9a39f to
d235f0d
Compare
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
c1d52b3 to
d73cd8c
Compare
9f63c24 to
2d4d917
Compare
2d4d917 to
a3952e9
Compare
- 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)
|
This pull request has been automatically marked as stale due to inactivity. |
|
Superseded by #87643, now merged as 27d6c8816721acf515715874961cfd3963a14582. The landed implementation adds a shared 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. |
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.tswith AI title generation. AddedaiTitlefield to SessionEntry, session-utils, session-entry-slot-keys, UI types. AddedsessionTitleconfig option with full schema entries. Fixed all lint and type errors. Ranopenclaw statusandopenclaw config get agents.defaultsto verify the config system.Evidence after fix: Terminal output from
openclaw statuson the live gateway showing active sessions where the title feature would apply:Terminal output from
openclaw config get agents.defaults:Schema diff for the new config option:
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).