Conversation
AmrDab
added a commit
that referenced
this pull request
Mar 19, 2026
Cherry-picked the best of both Codex audit PRs into a unified build: Security: - Log sanitization: API keys, Bearer tokens redacted from task logs (opt-out with CLAWD_DEBUG_RAW_LOGS=1) - Token fingerprinting: startup prints first 8 chars, not full token - Auth on sensitive GET endpoints: /favorites, /task-logs, /logs now require Bearer token (dashboard updated to include auth on all calls) Reliability: - Task execution lock: prevents TOCTOU race on concurrent /task requests - Clipboard fallback: catches a11y bridge failure, falls back to typeText - OCR temp file UUID suffix: prevents collision on concurrent OCR calls Infrastructure: - CDP port DRY: unified to 9223 everywhere (was 9222 in some, 9223 in others — real mismatch causing connection failures) - ESLint: Node.js + vitest globals, relaxed no-explicit-any - Test infra: tsconfig.tests.json, vitest covers tests/, withAuth helper new smoke tests for auth-protected endpoints - Install robustness: verify-install.js checks Node version + native deps with platform-specific fix guidance (addresses Dabbas install failure) 17 files modified, 2 new files. Build passes. 130/131 tests pass (1 pre-existing credential test failure unrelated to these changes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Motivation
/taskrequests by making task execution single-flight per Agent instance.Description
requireAuthto several endpoints insrc/server.tsincludingGET /favorites,GET /task-logs,GET /task-logs/current,GET /logs,GET /screenshot, and thePOST /actionpath so mutating and sensitive read routes require the Bearer token.tokenFingerprint()insrc/index.tsand replaced full-token logging with a short fingerprint when starting the API and tool servers, while keeping the full token saved to~/.clawdcursor/token.Agent.executeTaskby introducingtaskRunningand checking/setting it around task execution, and moved initialstatesetup earlier;taskRunningis always cleared in afinallyblock.ActionRouter.handleTypeto catch clipboard bridge failures and fall back todesktop.typeText(text)instead of failing the entire action.tsconfig.tests.json, addedtypecheckandtypecheck:testsscripts topackage.json, extendedvitest.config.tsto includetests/**, and updatedtests/smoke.test.tsto useinitServerToken()and awithAuthhelper for authenticated requests; also tweaked an OCR unit test expectation.Testing
npm test(Vitest); the test suite including updated smoke tests completed successfully.npm run typecheck:tests(usestsc --noEmit -p tsconfig.tests.json) andnpm run typecheck(tsc --noEmit) locally; both passed.Codex Task