fix(capture): read the session id off the SessionStart hook payload#493
Open
boskodev790 wants to merge 1 commit into
Open
fix(capture): read the session id off the SessionStart hook payload#493boskodev790 wants to merge 1 commit into
boskodev790 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
finalize-all resolved the current session id from --session-id or VOUCH_SESSION_ID only. the shipped SessionStart hook passes neither, and nothing in the adapter or runtime exports VOUCH_SESSION_ID, so sid was always "" and the sweep returned empty on every session start. that made the vouchdev#304 backstop dead: buffers orphaned by sessions that ended without SessionEnd accumulated in .vouch/captures/ and never rolled up into pending proposals, so the session never reached the review queue. the id now comes off the stdin payload the same way capture finalize reads it at SessionEnd, with --session-id and VOUCH_SESSION_ID kept as fallbacks. a malformed payload still no-ops rather than failing the host's turn. the adapter hook test asserted observe/finalize/banner but never finalize-all, which is why the shipped wiring went unexercised; it now covers it.
ead457d to
7e2030a
Compare
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.
What changed
vouch capture finalize-allnow resolves the current session id from the SessionStart hook payload on stdin — the same wirecapture finalizealready reads at SessionEnd.--session-idandVOUCH_SESSION_IDare kept as fallbacks, in that order.Why
fixes #492. the command resolved the id from
--session-idorVOUCH_SESSION_IDonly, but the shipped hook is barevouch capture finalize-all || trueand nothing in the adapter or runtime ever exportsVOUCH_SESSION_ID—grepfinds only the cli reader and two tests that set it themselves. sosidwas always""and the sweep returned{"finalized": [], ...}on every session start.that left the #304 backstop dead in the shipped configuration: buffers orphaned by sessions that ended without SessionEnd accumulated in
.vouch/captures/and never rolled up into pending proposals, so those sessions never reached the review queue at all.it went unnoticed because
test_adapter_settings_wires_capture_hooksassertedobserve/finalize/bannerbut neverfinalize-all, and every cli test for the command passed--session-idor the env var explicitly — the shipped path was the one path never exercised. that assertion is added here.What might break
nothing on disk: no file moves, no field changes shape, no
kb.*method behaves differently (capture finalize-allis CLI + SessionStart-hook only).the behaviour change is the intended one: on an existing
.vouch/, the first session start after upgrading will sweep any stale buffers that have been sitting incaptures/— each becomes one pending proposal, so a user with orphaned buffers may see several new items invouch review. nothing is auto-approved and the review gate is untouched. the>1hage guard still protects the current session's buffer, and precedence is unchanged for anyone already passing--session-idexplicitly.a malformed or absent stdin payload still no-ops rather than raising, preserving the hook's never-fail-the-turn contract.
VEP
not a surface change — no
kb.*method, object model, on-disk layout, bundle format or audit-log shape touched. no VEP.Tests
make checkpasses locally (lint + mypy + pytest) — 1379 passed, 49 skipped; ruff clean; mypy clean across 98 source filesNew / changed behaviour has a test
CHANGELOG.mdupdated under## [Unreleased]test_capture_finalize_all_cmd_reads_session_from_stdin— verified failing ontestwithout the src changetest_capture_finalize_all_cmd_survives_malformed_stdin— pins the never-fail-the-turn contracttest_capture_finalize_all_cmd_flag_beats_stdin— pins precedencetest_adapter_settings_wires_capture_hooksnow asserts the SessionStartfinalize-allwiringone thing i left alone deliberately:
observe,finalize,ingest-codex --hookand this command now each parse a stdin payload their own way. consolidating them behind one helper seemed worth doing separately rather than inside a bug fix — happy to send that as a follow-up if you want it.no ui surface touched, so no screenshots.