Skip to content

fix: graceful auth startup, test noise, bounded concurrency, noop scope#1

Merged
TC407-api merged 1 commit intomasterfrom
fix/review-findings
Mar 23, 2026
Merged

fix: graceful auth startup, test noise, bounded concurrency, noop scope#1
TC407-api merged 1 commit intomasterfrom
fix/review-findings

Conversation

@TC407-api
Copy link
Copy Markdown
Owner

Summary

  • Fix 1 (CRITICAL): Replace throw new Error() in createHttpApp() with a degraded 503 server to prevent Node process crash when no auth mode is configured
  • Fix 2 (CRITICAL): Suppress auth warning at module load time when NODE_ENV=test to eliminate test noise
  • Fix 3 (WARNING): Add bounded concurrency (limit=5) to Promise.all(memories.map(...)) patterns in src/cortex/pipeline.ts and src/titan.ts to prevent resource exhaustion with large memory sets
  • Fix 4 (MINOR): Change titan_noop scope from WRITE to READ in src/mcp/auth/scopes.ts

Files Changed

  • src/mcp/http-server.ts — graceful 503 instead of process crash (line 166)
  • src/utils/auth.ts — NODE_ENV guard on startup warning (line 32)
  • src/cortex/pipeline.tslimitConcurrency() helper + bounded highlight calls (lines 127-131, 244-254)
  • src/titan.ts — bounded concurrency for layer queries and highlight calls (lines 694-705, 1728-1738)
  • src/mcp/auth/scopes.ts — titan_noop scope WRITE→READ (line 61)

Test plan

  • npx tsc --noEmit passes clean
  • npm test — 1455/1457 passing (2 pre-existing failures in pattern-matcher and semantic tests, unrelated to changes)

🤖 Generated with Claude Code

- Replace throw in createHttpApp() with 503 degraded server to prevent
  Node process crash when no auth mode is configured
- Suppress auth warning at module load time when NODE_ENV=test
- Add bounded concurrency (limit=5) to Promise.all patterns in
  cortex/pipeline.ts and titan.ts to prevent resource exhaustion
- Change titan_noop scope from WRITE to READ

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TC407-api TC407-api merged commit 6f97b03 into master Mar 23, 2026
0 of 2 checks passed
@TC407-api TC407-api deleted the fix/review-findings branch March 23, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant