fix: true ephemeral commands — filter from LLM context instead of sweep#8
Merged
fix: true ephemeral commands — filter from LLM context instead of sweep#8
Conversation
Ephemeral slash commands (/history, /tree, /threads, /deref, /classify) were crashing with a schema validation error because afterTurns:0 violated LifecycleMeta's min(1) constraint. Instead of patching the value, replace the sweep-based ephemeral system with a true ephemeral filter (like Claude Code's /btw): messages marked ephemeral are dropped from the LLM context entirely via filterEphemeral(), so the Q&A is visible in the TUI but never pollutes the session thread. - Add MessageV2.filterEphemeral() — drops user+assistant pairs where all parts have lifecycle.hint === "ephemeral" - Call filterEphemeral in prompt loop before filterEdited - Remove sweep's ephemeral/externalize branch (only discardable remains) - Simplify ephemeral marking: no afterTurns/turnWhenSet needed - Add .int().min(1) to context_edit tool's afterTurns parameter - Make turnWhenSet optional in LifecycleMeta schema + SDK type - Remove unused imports and constants
2 tasks
e6qu
added a commit
that referenced
this pull request
Mar 18, 2026
…ep (#8) Ephemeral slash commands (/history, /tree, /threads, /deref, /classify) were crashing with a schema validation error because afterTurns:0 violated LifecycleMeta's min(1) constraint. Instead of patching the value, replace the sweep-based ephemeral system with a true ephemeral filter (like Claude Code's /btw): messages marked ephemeral are dropped from the LLM context entirely via filterEphemeral(), so the Q&A is visible in the TUI but never pollutes the session thread. - Add MessageV2.filterEphemeral() — drops user+assistant pairs where all parts have lifecycle.hint === "ephemeral" - Call filterEphemeral in prompt loop before filterEdited - Remove sweep's ephemeral/externalize branch (only discardable remains) - Simplify ephemeral marking: no afterTurns/turnWhenSet needed - Add .int().min(1) to context_edit tool's afterTurns parameter - Make turnWhenSet optional in LifecycleMeta schema + SDK type - Remove unused imports and constants Co-authored-by: Adrian Mârza <adi11235 at gmail dot com>
3 tasks
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.
Summary
/history,/tree, etc.) were failing becauseafterTurns: 0violatedLifecycleMeta'smin(1)constraintfilterEphemeral()(like Claude Code's/btw), so it's visible in the TUI but never pollutes the session threaddiscardableremains in sweep logic.int().min(1)oncontext_edittool'safterTurnsparamTest plan
tsc --noEmitpasses/historyor/treein a session — no schema validation error