Repository navigation
fix(hooks): port checkRalplan() and checkTeamPipeline() to persistent-mode.cjs - #1482
Merged
Merged
Conversation
Yeachan-Heo
approved these changes
Mar 9, 2026
Yeachan-Heo
left a comment
Owner
There was a problem hiding this comment.
Clean port of both first-class checks from src/hooks/persistent-mode/index.ts to scripts/persistent-mode.cjs.
Key things verified:
- Team pipeline (Priority 2.5): 20 reinforcements, 5-min TTL, proper phase/status detection, TOCTOU defense via cached
cancelInProgress✅ - Ralplan (Priority 2.6): 30 reinforcements, 45-min TTL, terminal phase detection ✅
- Stop breaker helpers: session-scoped, atomic writes, TTL-based cleanup ✅
- Priority 6 fallback:
teamPipelineHandledguard prevents double-blocking ✅ - Cancel bypass: properly inherited from cached check ✅
This completes #1479 — the runtime scripts now match the bridge code's stop-hook behavior.
LGTM ✅
—
[repo owner's gaebal-gajae (clawdbot) 🦞]
…-mode.cjs Follow-up to Yeachan-Heo#1480. Ports the first-class stop-hook enforcement for ralplan and team pipeline from src/hooks/persistent-mode/index.ts to the actual runtime script scripts/persistent-mode.cjs. Previously only generic skill-active-state protection existed in scripts/. This adds dedicated enforcement matching the bridge code: Team Pipeline (Priority 2.5): - Phase normalization with canonical field priority (phase → current_phase → currentStage → current_stage → stage) - Terminal phase detection (complete/failed/cancelled/etc.) - Known active phase gating with fail-open for unknown phases - Status-level terminal check - cancel.requested bypass - Circuit breaker: 20 reinforcements, 5-min TTL - Guards existing Priority 6 Team block to avoid double-handling Ralplan (Priority 2.6): - Terminal current_phase detection (complete/completed/failed/cancelled/done) - Session isolation via isSessionMatch() - Circuit breaker: 30 reinforcements, 45-min TTL Shared: - readStopBreaker() / writeStopBreaker() helpers with TTL-based expiry - Constants matching src/hooks/persistent-mode/index.ts exactly Refs: Yeachan-Heo#1479, Yeachan-Heo#1424, Yeachan-Heo#1432 Co-Authored-By: Claude Opus 4.6 <[email protected]>
lifrary
force-pushed
the
fix/port-ralplan-team-checks
branch
from
March 9, 2026 06:42
24ff0b8 to
5bc6956
Compare
ChoKhoOu
added a commit
to ChoKhoOu/oh-my-claudecode
that referenced
this pull request
Mar 10, 2026
The .cjs Stop hook outputs `{ decision: "block" }` without
`continue: false` when blocking stops for active modes. The original
fix (Yeachan-Heo#1216) added `continue: false` to the .mjs scripts but the .cjs
version was never updated, and subsequent commits (Yeachan-Heo#1306, Yeachan-Heo#1330, Yeachan-Heo#1374,
Yeachan-Heo#1480, Yeachan-Heo#1482) did not carry over this fix.
Since hooks.json references the .cjs version, the plugin Stop hook has
been missing hard-block capability, allowing sessions to end mid-execution.
- Add `continue: false` to all 12 blocking outputs in persistent-mode.cjs
- Add `continue: false` to context-guard-stop.mjs (1 output)
- Add `continue: false` to code-simplifier.mjs and its template (1 each)
Closes Yeachan-Heo#1516
3 tasks done
Yeachan-Heo
added a commit
that referenced
this pull request
Mar 11, 2026
…arch (#1549) * feat(setup): add rtk token optimization integration * revert(setup): remove RTK integration from PR #1489 * fix(hooks): fail open on critical context exhaustion * fix(skill): harden omc-teams tmux and agent validation * Add Ralph critic selection for verification * fix(doctor): accept supported omc config keys * feat(openclaw): normalize native clawhip signals * fix: skip legacy agent sync when plugin agents exist * fix(hud): preserve stale usage limits on API failures * Reduce startup OMC guidance context * fix: clean up stale transient files on session end (#1510) - session-end: cleanupTransientState now removes agent-replay-*.jsonl, last-tool-error.json, hud-state.json, hud-stdin-cache.json, idle-notif-cooldown.json, *-stop-breaker.json, cancel-signal files inside session dirs, and empty session directories - keyword-detector: activateState adds project_path field for parity with TypeScript activateUltrawork in bridge.ts - persistent-mode: readStateFileWithSession adds fallback scan of all session directories when session-scoped path lookup fails * fix(hud): reduce transient usage API retry hammering (#1513) * fix(hooks): add missing continue: false to persistent-mode.cjs Stop hook The .cjs Stop hook outputs `{ decision: "block" }` without `continue: false` when blocking stops for active modes. The original fix (#1216) added `continue: false` to the .mjs scripts but the .cjs version was never updated, and subsequent commits (#1306, #1330, #1374, #1480, #1482) did not carry over this fix. Since hooks.json references the .cjs version, the plugin Stop hook has been missing hard-block capability, allowing sessions to end mid-execution. - Add `continue: false` to all 12 blocking outputs in persistent-mode.cjs - Add `continue: false` to context-guard-stop.mjs (1 output) - Add `continue: false` to code-simplifier.mjs and its template (1 each) Closes #1516 * feat(doc-specialist): add first-pass context hub guidance (#1519) * Add skill pipeline handoff metadata (#1520) * chore: remove stale root development artifacts (#1526) * docs(rebrand): update scoped guidance docs (#1527) * docs: rebrand main README to oh-my-openagent (#1528) * docs: rebrand localized readmes to oh-my-openagent (#1529) * revert: undo unauthorized rebrand PRs 1527-1529 * docs: fix outdated install references in REFERENCE.md - Update platform support table: "curl or npm" → "Claude Code Plugin" for macOS/Linux, consistent with the deprecation notice at the top of the Installation section - Replace deprecated curl uninstall one-liner with the plugin uninstall command (/plugin uninstall oh-my-claudecode@oh-my-claudecode) Co-Authored-By: Claude Opus 4.6 <[email protected]> * docs: remove stale analytics references * fix(team): port startup hardening from omx * fix(team): finish runtime hardening port * fix(team): resolve worktree mailbox trigger paths * fix(hud): avoid repeated watch mode initialization * feat: add session history search * fix(team): require real startup evidence * fix(routing): normalize explicit model IDs in all code paths (#1415) The prior fix (PR #1464) only normalized auto-injected models but missed two paths where full model IDs like 'claude-sonnet-4-6' leaked through: 1. enforceModel() passed explicitly-provided models as-is without normalizing to CC aliases (sonnet/opus/haiku) 2. buildLaunchArgs() in model-contract.ts passed model directly to --model flag for team worker launches Extract normalizeToCcAlias() helper and apply it in both paths. Add 5 tests covering explicit ID normalization and Bedrock ID handling. Closes #1415 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * chore(release): bump version to v4.7.10 Version bumps: - package.json: 4.7.9 → 4.7.10 - .claude-plugin/plugin.json: 4.7.9 → 4.7.10 - .claude-plugin/marketplace.json: 4.7.9 → 4.7.10 - CHANGELOG.md: Updated release header Includes rebuilt dist artifacts for: - Bedrock model routing fixes - Team runtime hardening - Session history search feature - Lazy agent loading Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: ChoKhoOu <[email protected]> Co-authored-by: Yong <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Carlos Cubas <[email protected]>
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
Follow-up to #1480. Ports first-class stop-hook enforcement for ralplan and team
pipeline from
src/hooks/persistent-mode/index.tstoscripts/persistent-mode.cjs.readStopBreaker()/writeStopBreaker()helpers with TTL-based expirydetection, active-phase gating, status-level checks, and circuit breaker
cancelInProgressfor TOCTOU defense (fix: hook system — duplicate Ralph loop, cancel TOCTOU, mode list copies #1058)Refs #1479
Parameters (matching bridge code)
Changes from code review
cancelInProgressbypass inside team pipeline and ralplan blocks (TOCTOU defense)!isStaleState()check for ralplan (consistency with all other modes)"canceled"(American spelling) to ralplan terminal phasesTest plan
node -c)readStopBreaker,writeStopBreaker,readStateFileWithSession,isSessionMatch,writeJsonFile,unlinkSync) verified to existsrc/hooks/persistent-mode/index.tsexactly/ralplan, verify stop is blocked with[RALPLAN - CONSENSUS PLANNING]/team, verify stop is blocked with[TEAM PIPELINE - PHASE:]🤖 Generated with Claude Code