- Add in-process isRunning flag to block reentrant runBatch (file lock
fails when pid === process.pid)
- Replace setInterval + double immediate trigger with self-scheduling
setTimeout that only fires after previous batch awaits
- Move clearQueue() to right after readQueue() so any unexpected
concurrent runBatch sees an empty queue and exits immediately
- Cache repoInfo and workingTreeDiff in processTask, pass into all three
upload functions to halve git invocations per task
- Add 30s AbortController timeout on postJson fetch so the worker no
longer hangs indefinitely on unresponsive networks
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add headless fallback in `hasPermissionsToUseToolInner` that respects
`askUserQuestionTimeoutSeconds` from settings (default 600s) when
`shouldAvoidPermissionPrompts` is true, instead of hanging indefinitely
- Set `shouldAvoidPermissionPrompts: true` on `toolPermissionContext` in
`-p` (pipe/headless) mode so the new path is triggered
- Hoist `parsedInput` before the try block so the headless path can use
Zod-transformed input (includes defaults like `multiSelect: false`)
Replace per-turn detached workers with a file-backed queue consumed by
a single long-running batch worker (30s interval, 0-10s jitter).
- queue.ts, batchWorker.ts: file queue with pid-based lock for worker
singleton; tasks deduped by sessionID:messageID before processing
- worker.ts: retry with backoff (5s, 10s) for 429 and network errors;
update commit state per upload so partial failures resume cleanly;
export auth, loadSessionMessages, getSessionDirectory and upload*
helpers for batchWorker reuse
- git.ts: cap commit log at 50 entries within last 7 days; pause 500ms
every 10 commits to spread load
- worker.ts: resolve session jsonl via ~/.claude/projects/{normalized}
with fallbacks, scanning for the file containing the target session
- logger.ts: file + stderr logger gated by CSC_RAW_DUMP_DEBUG, default
silent
- sessionDataUploader.ts: implement createSessionTurnUploader to pick
the last assistant message; query.ts fires uploadSessionTurn after
query_api_streaming_end (non-blocking)
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Introduce a framework-decoupled raw-dump module that uploads conversation, summary, and commits data to the CoStrict server in a non-blocking detached worker process.
- Add src/services/rawDump/ with index, types, state, spawn, git, worker, and README
- Implement reportTurn and reportSession entry points with in-memory dedup and env-based disable switch (CSC_DISABLE_RAW_DUMP / COSTRICT_DISABLE_RAW_DUMP)
- Replace sessionDataUploader stub with uploadSessionTurn that delegates to reportTurn
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Files are still present on disk and generated by build:review-builtin.
.gitignore rules prevent them from being re-committed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add generate-review-builtin.ts script (downloads from zgsm-ai/costrict-review)
- Add review module (index.ts, extension.ts) with locale-aware skill init
- Add CommandLocale module with zh-CN/en templates for /review and /security-review
- Integrate REVIEW_AGENTS into builtInAgents.ts
- Route /review command to CoStrictReviewer agent
- Simplify /security-review to use Skill tool with locale templates
- Remove old generate-skills.ts and inline security-review skill
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>