Skip to content

Sessions: opt-in star→project-registration hook - #226

Open
arsenmuk wants to merge 1 commit into
mainfrom
arsenmuk/star-project-hook
Open

Sessions: opt-in star→project-registration hook#226
arsenmuk wants to merge 1 commit into
mainfrom
arsenmuk/star-project-hook

Conversation

@arsenmuk

Copy link
Copy Markdown
Member

Adds an opt-in hook: when sessions.star_project_hook is enabled (default off), a starred 0↔1 transition fires a one-shot internal agent turn in that same session — star → promote it to a project (create its Task card), unstar → archive it.

Default off ⇒ no change for anyone else. With the flag off the guard short-circuits before any turn, so starring stays exactly what it is today: a retention pin (exempts a session from the max-session cap, idle auto-close, and memory compaction). Mirrors the opt-in RetentionConfig pattern.

Changes

  • config.py: SessionsConfig.star_project_hook: bool = False (+ from_dict).
  • sessions.py: on a starred transition, when enabled, fire engine.run(..., internal=True). Non-blocking; the internal turn isn't stored or shown in the UI. Hook failures are caught + logged — they never break the PATCH response.

Activation: enable the flag in config; takes effect after a gateway restart.

When sessions.star_project_hook is enabled (default off), a starred 0<->1
transition fires a one-shot internal agent turn in that same session so the
agent can promote the session to a project (create its Task card) or archive it.

Default off => no behavior change: with the flag off the guard short-circuits
before any turn, so starring stays a pure retention pin. Mirrors the opt-in
RetentionConfig pattern.

- config.py: SessionsConfig.star_project_hook: bool = False (+ from_dict).
- sessions.py: gate the hook on the flag; fire engine.run(..., internal=True)
  on transition. try/except keeps the PATCH working; the internal turn is not
  stored or shown in the UI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arsenmuk
arsenmuk marked this pull request as ready for review July 30, 2026 12:49
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