Skip to content

feat: context management, clean restart and session folder fixes - #23

Merged
lucamangiacotti-dev merged 2 commits into
mainfrom
feat/context-management-session-state
Nov 15, 2026
Merged

lucamangiacotti-dev merged 2 commits into
mainfrom
feat/context-management-session-state

Conversation

@lucamangiacotti-dev

Copy link
Copy Markdown
Contributor

Summary

  • Context management (off by default, in Settings): the main Claude session can keep state.md and logbook.md in <workspace>/.promptops/sessions/<id>/. It is turned on per workspace from the notebook icon in the session header, which first offers to exclude the folder from git (.git/info/exclude or .gitignore). The instructions reach the agent through --append-system-prompt-file when the CLI accepts it, or as one message on request. Writes to those two exact files are approved, never through a symbolic link. The state opens the handoff when the provider changes. Everything stays on the device; PROMPTOPS_SESSION_STATE=0 turns it off.
  • Clean restart: a fresh conversation with the same provider, command and arguments, started from an editable handoff draft (new multi-line mode of the alert dialog).
  • Session folder: changing the folder of an existing session is now applied by the desktop session on the next spawn or wake, and is no longer written back to the old path on exit.
  • Heavy-context notice: the 15-minute cooldown starts when the notice is shown, so a session that was off screen still gets it. The threshold is computed from the model window when it is known (unchanged for Claude: 120k).
  • Tooltips: agent tooltips in the sidebar open beside the row (appTooltipPlacement="right"), and long tooltips are cut at eight lines.
  • Tests: the termd resize test also runs on Windows.
  • 19 new strings in all 15 languages, changelog entries under Unreleased.

Left out

  • The reworked per-process hook install (per-session tracking, cleanup of stale workspace hook entries, login-shell probe for --settings): this repository already passes the hooks with --settings through its own implementation and private-file helpers. Aligning the two is a separate change.
  • Guards against a 200 response without a list in the sessions, workspaces and folders services: they protect an HTTP client; here the lists come from the local store through DataBackend.
  • The version dialog in the bottom bar: it is wired to a different updater than desktop-update.service.ts, so it needs its own adaptation.
  • The Windows shell and Claude test matrices in windows_shells.rs: #[ignore]d, Windows-only tests that could not be compiled or run here.
  • Codex context-window fields in codex_rollout.rs: nothing reads them yet, so they would only add dead code under -D warnings.

Testing

  • ng test: 657 of 657 (2 new specs for the long-text dialog)

  • ng build --configuration=desktop

  • cargo check, cargo fmt --check (app and termd), cargo clippy --lib --all-targets -- -D warnings

  • cargo test --lib: 557 passed, 1 failed locally (db::tests::mongo_spec_script_carries_the_spec_as_data, a broken local mongosh install; not touched by this change); the 12 tests of the touched modules pass

  • termd cargo test: 14 of 14 end-to-end tests, including the resize test

  • Not yet tried in the running app.

  • Windows: the approval of state.md / logbook.md now compares real paths without the verbatim prefix (\\?\) and without case, so it works on Windows too; the test builds its paths from a real folder.

Replaces #22 (same commits, branch renamed after what it contains).

🤖 Generated with Claude Code

lucamangiacotti-dev and others added 2 commits November 15, 2026 00:48
Context management (off by default, in Settings): the main Claude session
can keep state.md and logbook.md in <workspace>/.promptops/sessions/<id>/.
It is turned on per workspace from the session header, which offers to
exclude the folder from git first. The instructions reach the agent through
--append-system-prompt-file when the CLI accepts it, or as one message on
request. Writes to those two exact files are approved (never through a
symbolic link), and the state opens the handoff when the provider changes.
PROMPTOPS_SESSION_STATE=0 turns the feature off.

Clean restart starts a fresh conversation with the same provider from an
editable handoff draft, keeping the command and arguments of the session.

Fixes: a changed session folder is applied by the desktop session on the
next spawn or wake instead of being written back on exit; the heavy-context
notice starts its cooldown when it is shown; sidebar agent tooltips open
beside the row and long tooltips are cut at eight lines. The termd resize
test now also runs on Windows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Luca Mangiacotti <luca.mangiacotti@shellonback.com>
canonicalize answers with the verbatim prefix on Windows, so the approved path never matched and every state save asked for permission. Paths are now compared without the prefix and without case there; the test uses a real canonical base instead of /w.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: LMG <luca.mangiacotti@shellonback.com>
@lucamangiacotti-dev
lucamangiacotti-dev merged commit 4fe265b into main Nov 15, 2026
29 checks passed
@lucamangiacotti-dev
lucamangiacotti-dev deleted the feat/context-management-session-state branch November 15, 2026 00:41
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