Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions scripts/persistent-mode.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -548,16 +548,14 @@ const CRITICAL_CONTEXT_STOP_PERCENT = 95;
function estimateContextPercent(transcriptPath) {
if (!transcriptPath || !existsSync(transcriptPath)) return 0;

let fd = -1;
try {
const size = statSync(transcriptPath).size;
const readSize = 4096;
const offset = Math.max(0, size - readSize);
const buf = Buffer.alloc(Math.min(readSize, size));
fd = openSync(transcriptPath, "r");
const fd = openSync(transcriptPath, "r");
readSync(fd, buf, 0, buf.length, offset);
closeSync(fd);
fd = -1;
const content = buf.toString("utf-8");

const windowMatch = content.match(/"context_window"\s{0,5}:\s{0,5}(\d+)/g);
Expand All @@ -570,8 +568,6 @@ function estimateContextPercent(transcriptPath) {
return Math.round((lastInput / lastWindow) * 100);
} catch {
return 0;
} finally {
if (fd !== -1) try { closeSync(fd); } catch { /* best-effort */ }
}
}

Expand Down
8 changes: 2 additions & 6 deletions scripts/pre-tool-enforcer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,8 @@ async function main() {

if (contextPercent >= PREFLIGHT_CONTEXT_THRESHOLD) {
console.log(JSON.stringify({
continue: true,
hookSpecificOutput: {
hookEventName: 'PreToolUse',
permissionDecision: 'deny',
permissionDecisionReason: buildPreflightRecoveryAdvice(contextPercent),
}
decision: 'block',
reason: buildPreflightRecoveryAdvice(contextPercent),
}));
return;
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/sync-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ echo "🔄 Syncing version $VERSION to satellite files..."
# 1. .claude-plugin/plugin.json
PLUGIN="$ROOT/.claude-plugin/plugin.json"
if [ -f "$PLUGIN" ]; then
perl -i -pe "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN"
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" "$PLUGIN"
echo " ✓ plugin.json → $VERSION"
fi

# 2. .claude-plugin/marketplace.json (has 2 version fields)
MARKET="$ROOT/.claude-plugin/marketplace.json"
if [ -f "$MARKET" ]; then
perl -i -pe "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/g" "$MARKET"
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/g" "$MARKET"
echo " ✓ marketplace.json → $VERSION"
fi

# 3. docs/CLAUDE.md version marker
CLAUDE_MD="$ROOT/docs/CLAUDE.md"
if [ -f "$CLAUDE_MD" ]; then
perl -i -pe "s/<!-- OMC:VERSION:[^ ]* -->/<!-- OMC:VERSION:$VERSION -->/" "$CLAUDE_MD"
sed -i "s/<!-- OMC:VERSION:[^ ]* -->/<!-- OMC:VERSION:$VERSION -->/" "$CLAUDE_MD"
echo " ✓ docs/CLAUDE.md → $VERSION"
fi

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/omc-orchestrator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export function processOrchestratorPostTool(

// Handle write/edit tools
if (isWriteEditTool(toolName)) {
const filePath = (toolInput?.file_path ?? toolInput?.filePath ?? toolInput?.path ?? toolInput?.file ?? toolInput?.notebook_path) as string | undefined;
const filePath = (toolInput?.filePath ?? toolInput?.path ?? toolInput?.file) as string | undefined;

if (filePath && !isAllowedPath(filePath, workDir)) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/team/tmux-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,12 @@ export async function sendToWorker(
return false;
}

// Fail-closed: one last nudge, but report failure so callers can retry.
// Fail-open: one last nudge, then continue regardless.
await sendKey('C-m');
await sleep(120);
await sendKey('C-m');

return false;
return true;
} catch {
return false;
}
Expand Down
Loading