Skip to content

fix(harness): persist session title across client reloads#7

Merged
OmGuptaIND merged 1 commit intomainfrom
OmGuptaIND/fix-title-persist
Apr 22, 2026
Merged

fix(harness): persist session title across client reloads#7
OmGuptaIND merged 1 commit intomainfrom
OmGuptaIND/fix-title-persist

Conversation

@OmGuptaIND
Copy link
Copy Markdown
Contributor

Summary

  • Add `writeHarnessSessionTitle()` in `agent-core/src/harness/mirror.ts` to persist a harness session title to `meta.json`, and wire it into the server's `set_session_title` handler so the model's chosen title survives a client reload (the `title_update` event only reaches connected clients).
  • In `onTurnEnd`, prefer `session.getTitle()` over the assistant's first text snippet when seeding the title, so `meta.json` no longer latches onto AI prose like "I'm checking your Google Calendar accounts…".
  • Read back through `getTitle()` after `setTitle()` so disk and memory stay in lockstep with the session's own normalization rules.

Test plan

  • Start a harness session, let the model call `set_session_title`, reload the client — title persists.
  • Start a harness session, do not call `set_session_title`, run a turn — `meta.json` still gets a sensible title (first text fallback).
  • Call `set_session_title` mid-session after turn 0 has already written a fallback title — new title overwrites the fallback in `meta.json`.

🤖 Generated with Claude Code

Add writeHarnessSessionTitle() and call it from the server's set_session_title
handler so the model's chosen title survives a client reload. Also prefer
session.getTitle() over the assistant's first text snippet when seeding the
title in appendHarnessTurn, so meta.json no longer latches onto AI prose.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@OmGuptaIND OmGuptaIND merged commit 3ecef19 into main Apr 22, 2026
@OmGuptaIND OmGuptaIND deleted the OmGuptaIND/fix-title-persist branch April 22, 2026 11:36
OmGuptaIND added a commit that referenced this pull request Apr 24, 2026
### Features
- multi-format file attachments with @-mentions and preview renderers (#12)

### Fixes
- pnpm lock
- workspace safety net — no more /root EACCES, atomic writes, version handshake (#11)

### Chores
- clean up biome lint + format across repo

### Other
- feat(desktop): remove new-project attachments, add text-file creator in files view (#10)
- feat(desktop): reasoning effort pill + provider modal redesign + onboarding tour (#9)
- fix(desktop): honor real harness readiness in provider UI (#8)
- fix(harness): persist session title to meta.json across reloads (#7)
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.

1 participant