You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
session-flow: remove a delivered absence's away state so idle hook cost returns to the cheap path #17389
session-flow's always-registered away hooks cost about 0.02 s per prompt and turn end when no away state exists (Python never starts). Once any away/ directory exists under the plugin data dir, the cost is about 0.09 s. A finished absence's state stays in place, so every later session pays the higher cost.
Done looks like
deliver (or end) removes a finished absence's state, or keeps it for a stated bounded retention.
After a delivered absence, no away/<session> directory remains (or only within the retention bound).
Measured idle hook cost in a session with no active absence is back to about 0.02 s, with the measurement recorded in the PR.
Tests cover the cleanup, and the report remains readable after delivery for as long as the retention says.
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: session-flow's away deliver/end path and its tests; everyone running the plugin's away hooks.
Reversible: yes; revert the cleanup change.
Open questions: none
Understood: after an absence is delivered, its away/<session> state should be removed (or kept only for a stated bounded retention) so idle hooks go back to the cheap no-Python path, with tests and a recorded measurement. Whether to delete immediately or keep a short retention is an implementation choice for the issue lane. Related, not duplicates: #17337 (referenced) and the open issue on where away.py state lives. No merged PR appears to fix this already. The measurement in the PR may need a person or host run.
Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited; its title or stated work names a charge (retention), which needs an owner decision. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).
Reason: cost
melodic-automation-lanes commented on Nov 19, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.
Intended outcome: After deliver, session-flow removes the delivered absence's away/<session> state (and away/ once empty) so the idle hook takes the no-Python exit, while the report stays readable for a stated retention.
Should deliver delete the state at once, or keep it for a bounded retention? The issue allows either, and a retention needs a prune site.
RECOMMENDED: Delete state.json, refused.jsonl and lock at deliver and keep only the report. The hook takes the cheap path only while away/ is absent, so a retention would keep the cost. Basis: plugins/session-flow/hooks/run-away-hook.sh:8
Where should the report live after delivery? report_path can be inside the state dir (report.md beside state), which cleanup would delete, or in git-ignored .work/away, which it would not.
RECOMMENDED: On deliver remove the state files but keep the report; when report_path is inside the state dir, move it to a stated retained location first, since the issue requires it to stay readable. Basis: plugins/session-flow/scripts/away.py:468
Should deliver also rmdir away/ when empty, and should a failed cleanup fail deliver?
RECOMMENDED: Yes, rmdir away/ when empty and ignore OSError if other sessions remain; a cleanup failure should be logged but not fail deliver. Basis: plugins/session-flow/scripts/away.py:953
Should end also remove state? end leaves status ended, and the ended-to-delivered move is what the UserPromptSubmit hook uses to show the report once.
RECOMMENDED: No: clean up only in deliver, since end must keep state for the show-once flow. Update MOVES so a later start after deliver still begins a fresh absence. Basis: plugins/session-flow/scripts/away.py:1106
The idle cost measurement (0.02 s vs 0.09 s) needs a timed run on a host. Is it required in the PR, or may a test assert the early exit instead?
RECOMMENDED: Add a test that runs run-away-hook.sh after deliver and checks it exits without starting Python; leave the timed measurement to a person. Basis: judgment
Sources read
plugins/session-flow/scripts/away.py:953: cmd_deliver only sets status delivered and a timestamp; nothing is removed
plugins/session-flow/scripts/away.py:468: choose_report_path falls back to state_dir/report.md when .work/away is not git-ignored
plugins/session-flow/scripts/away.py:933: cmd_end copies the report to away/<session>/report.md
plugins/session-flow/scripts/away.py:1091: UserPromptSubmit hook returns nothing for delivered status and shows the report once for ended
plugins/session-flow/hooks/run-away-hook.sh:8: hook exits before Python when $DATA/away is absent
plugins/session-flow/scripts/tests/test_away.py: existing away tests to extend
To answer, post a comment that starts with this line:
**Decision recorded.** <answer>
Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.
Activity
github-actions commentedon Nov 19, 2026
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: session-flow's away deliver/end path and its tests; everyone running the plugin's away hooks.
Reversible: yes; revert the cleanup change.
Open questions: none
Understood: after an absence is delivered, its
away/<session>state should be removed (or kept only for a stated bounded retention) so idle hooks go back to the cheap no-Python path, with tests and a recorded measurement. Whether to delete immediately or keep a short retention is an implementation choice for the issue lane. Related, not duplicates: #17337 (referenced) and the open issue on where away.py state lives. No merged PR appears to fix this already. The measurement in the PR may need a person or host run.Automated triage. A maintainer reviews it.
melodic-automation-lanes commentedon Nov 19, 2026
Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed
- [ ]criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited; its title or stated work names a charge (retention), which needs an owner decision. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).Reason:
costmelodic-automation-lanes commentedon Nov 19, 2026
The latest triage verdict holds nothing: admission moved the issue to
needs-owner-decision; its comment says why.melodic-automation-lanes commentedon Nov 19, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.
Intended outcome: After deliver, session-flow removes the delivered absence's away/<session> state (and away/ once empty) so the idle hook takes the no-Python exit, while the report stays readable for a stated retention.
Related work
Open questions
RECOMMENDED: Delete state.json, refused.jsonl and lock at deliver and keep only the report. The hook takes the cheap path only while away/ is absent, so a retention would keep the cost. Basis: plugins/session-flow/hooks/run-away-hook.sh:8
RECOMMENDED: On deliver remove the state files but keep the report; when report_path is inside the state dir, move it to a stated retained location first, since the issue requires it to stay readable. Basis: plugins/session-flow/scripts/away.py:468
RECOMMENDED: Yes, rmdir away/ when empty and ignore OSError if other sessions remain; a cleanup failure should be logged but not fail deliver. Basis: plugins/session-flow/scripts/away.py:953
RECOMMENDED: No: clean up only in deliver, since end must keep state for the show-once flow. Update MOVES so a later start after deliver still begins a fresh absence. Basis: plugins/session-flow/scripts/away.py:1106
RECOMMENDED: Add a test that runs run-away-hook.sh after deliver and checks it exits without starting Python; leave the timed measurement to a person. Basis: judgment
Sources read
To answer, post a comment that starts with this line:
Automated refinement by the lanes App. Answer with a comment whose first line is
**Decision recorded.**.