mirror of
https://github.com/dtzp555-max/ocp.git
synced 2026-07-22 13:35:08 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b169952039 | ||
|
|
733a2ed4c2 | ||
|
|
ca2d23d230 |
@@ -4,6 +4,10 @@ description: Perform a non-destructive cross-artifact consistency and quality an
|
|||||||
argument-hint: "Optional focus areas for analysis"
|
argument-hint: "Optional focus areas for analysis"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/analyze.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Generate a custom checklist for the current feature based on user r
|
|||||||
argument-hint: "Domain or focus area for the checklist"
|
argument-hint: "Domain or focus area for the checklist"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/checklist.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## Checklist Purpose: "Unit Tests for English"
|
## Checklist Purpose: "Unit Tests for English"
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Identify underspecified areas in the current feature spec by asking
|
|||||||
argument-hint: "Optional areas to clarify in the spec"
|
argument-hint: "Optional areas to clarify in the spec"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/clarify.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Create or update the project constitution from interactive or provi
|
|||||||
argument-hint: "Principles or values for the project constitution"
|
argument-hint: "Principles or values for the project constitution"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/constitution.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Execute the implementation plan by processing and executing all tas
|
|||||||
argument-hint: "Optional implementation guidance or task filter"
|
argument-hint: "Optional implementation guidance or task filter"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/implement.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Execute the implementation planning workflow using the plan templat
|
|||||||
argument-hint: "Optional guidance for the planning phase"
|
argument-hint: "Optional guidance for the planning phase"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/plan.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Create or update the feature specification from a natural language
|
|||||||
argument-hint: "Describe the feature you want to specify"
|
argument-hint: "Describe the feature you want to specify"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/specify.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Generate an actionable, dependency-ordered tasks.md for the feature
|
|||||||
argument-hint: "Optional task generation constraints"
|
argument-hint: "Optional task generation constraints"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/tasks.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ description: Convert existing tasks into actionable, dependency-ordered GitHub i
|
|||||||
argument-hint: "Optional filter or label for GitHub issues"
|
argument-hint: "Optional filter or label for GitHub issues"
|
||||||
user-invocable: true
|
user-invocable: true
|
||||||
disable-model-invocation: false
|
disable-model-invocation: false
|
||||||
|
compatibility: "Requires spec-kit project structure with .specify/ directory"
|
||||||
|
metadata:
|
||||||
|
author: github-spec-kit
|
||||||
|
source: claude:templates/commands/taskstoissues.md
|
||||||
---
|
---
|
||||||
|
|
||||||
## User Input
|
## User Input
|
||||||
|
|||||||
@@ -604,7 +604,7 @@ cmd_restart() {
|
|||||||
self_r="${BASH_SOURCE[0]}"
|
self_r="${BASH_SOURCE[0]}"
|
||||||
while [[ -L "$self_r" ]]; do self_r="$(readlink "$self_r")"; done
|
while [[ -L "$self_r" ]]; do self_r="$(readlink "$self_r")"; done
|
||||||
script_dir="$(cd "$(dirname "$self_r")" && pwd)"
|
script_dir="$(cd "$(dirname "$self_r")" && pwd)"
|
||||||
nohup node "$script_dir/server.mjs" >> "$HOME/.ocp/logs/proxy.log" 2>&1 &
|
DISABLE_AUTOUPDATER=1 nohup node "$script_dir/server.mjs" >> "$HOME/.ocp/logs/proxy.log" 2>&1 &
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
if curl -sf --max-time 5 "$PROXY/health" > /dev/null 2>&1; then
|
if curl -sf --max-time 5 "$PROXY/health" > /dev/null 2>&1; then
|
||||||
|
|||||||
+19
-3
@@ -165,9 +165,18 @@ const sessions = new Map(); // conversationId → { uuid, messageCount, lastUsed
|
|||||||
const sessionCleanupInterval = setInterval(() => {
|
const sessionCleanupInterval = setInterval(() => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
for (const [id, s] of sessions) {
|
for (const [id, s] of sessions) {
|
||||||
if (now - s.lastUsed > SESSION_TTL) {
|
const idleMs = now - s.lastUsed;
|
||||||
|
const ageMs = s.firstSeen ? now - s.firstSeen : null;
|
||||||
|
if (idleMs > SESSION_TTL) {
|
||||||
sessions.delete(id);
|
sessions.delete(id);
|
||||||
console.log(`[session] expired ${id.slice(0, 12)}... (idle ${Math.round((now - s.lastUsed) / 60000)}m)`);
|
console.log(`[session] expired ${id.slice(0, 12)}... (idle ${Math.round(idleMs / 60000)}m)`);
|
||||||
|
logEvent("info", "session_expired", { conversationId: id.slice(0, 12) + "...", idleMs, ageMs });
|
||||||
|
} else if (ageMs !== null && ageMs > 4 * SESSION_TTL) {
|
||||||
|
// #42 evidence-gathering: a session whose firstSeen is more than 4× TTL old
|
||||||
|
// but whose lastUsed keeps getting bumped (never idle long enough to expire)
|
||||||
|
// is the suspected bug. Log without action so the pattern can be confirmed
|
||||||
|
// in /logs. Do NOT enforce an absolute age cap here speculatively.
|
||||||
|
logEvent("warn", "session_long_lived", { conversationId: id.slice(0, 12) + "...", idleMs, ageMs });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60000);
|
}, 60000);
|
||||||
@@ -406,7 +415,8 @@ function spawnClaudeProcess(model, messages, conversationId) {
|
|||||||
|
|
||||||
} else if (conversationId) {
|
} else if (conversationId) {
|
||||||
const uuid = randomUUID();
|
const uuid = randomUUID();
|
||||||
sessions.set(conversationId, { uuid, messageCount: messages.length, lastUsed: Date.now(), model: cliModel });
|
const now = Date.now();
|
||||||
|
sessions.set(conversationId, { uuid, messageCount: messages.length, firstSeen: now, lastUsed: now, model: cliModel });
|
||||||
sessionInfo = { uuid, resume: false };
|
sessionInfo = { uuid, resume: false };
|
||||||
stats.sessionMisses++;
|
stats.sessionMisses++;
|
||||||
prompt = messagesToPrompt(messages);
|
prompt = messagesToPrompt(messages);
|
||||||
@@ -458,7 +468,13 @@ function spawnClaudeProcess(model, messages, conversationId) {
|
|||||||
function handleSessionFailure() {
|
function handleSessionFailure() {
|
||||||
if (sessionInfo?.resume && conversationId) {
|
if (sessionInfo?.resume && conversationId) {
|
||||||
console.warn(`[session] resume failed for ${conversationId.slice(0, 12)}..., removing stale session`);
|
console.warn(`[session] resume failed for ${conversationId.slice(0, 12)}..., removing stale session`);
|
||||||
|
logEvent("warn", "session_failure", { mode: "resume", conversationId: conversationId.slice(0, 12) + "...", action: "deleted" });
|
||||||
sessions.delete(conversationId);
|
sessions.delete(conversationId);
|
||||||
|
} else if (sessionInfo && !sessionInfo.resume && conversationId) {
|
||||||
|
// #41 evidence-gathering: session-create failures currently leave a stale entry
|
||||||
|
// in the sessions map. Log without action so the staleness pattern can be
|
||||||
|
// confirmed in /logs before any code change. Do NOT delete here speculatively.
|
||||||
|
logEvent("warn", "session_failure", { mode: "create", conversationId: conversationId.slice(0, 12) + "...", action: "kept" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user