Sessions: opt-in star→project-registration hook - #226
Open
arsenmuk wants to merge 1 commit into
Open
Conversation
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
marked this pull request as ready for review
July 30, 2026 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt-in hook: when
sessions.star_project_hookis enabled (default off), astarred0↔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
RetentionConfigpattern.Changes
config.py:SessionsConfig.star_project_hook: bool = False(+from_dict).sessions.py: on astarredtransition, when enabled, fireengine.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.