revert: roll back v12.3.3 (Issue Blowout 2026)
SessionStart context injection regressed in v12.3.3 — no memory context is being delivered to new sessions. Rolling back to the v12.3.2 tree state while the regression is investigated. Reverts #2080. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,7 @@ export class SettingsDefaultsManager {
|
||||
private static readonly DEFAULTS: SettingsDefaults = {
|
||||
CLAUDE_MEM_MODEL: 'claude-sonnet-4-6',
|
||||
CLAUDE_MEM_CONTEXT_OBSERVATIONS: '50',
|
||||
CLAUDE_MEM_WORKER_PORT: String(37700 + ((process.getuid?.() ?? 77) % 100)),
|
||||
CLAUDE_MEM_WORKER_PORT: '37777',
|
||||
CLAUDE_MEM_WORKER_HOST: '127.0.0.1',
|
||||
CLAUDE_MEM_SKIP_TOOLS: 'ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion',
|
||||
// AI Provider Configuration
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import { randomBytes } from 'crypto';
|
||||
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { DATA_DIR } from './paths.js';
|
||||
|
||||
const TOKEN_FILENAME = 'worker-auth-token';
|
||||
let cachedToken: string | null = null;
|
||||
|
||||
/**
|
||||
* Get or generate the bearer token for worker API auth.
|
||||
* Token is stored in DATA_DIR/worker-auth-token and cached in memory.
|
||||
* All API requests must include this as: Authorization: Bearer <token>
|
||||
*/
|
||||
export function getAuthToken(): string {
|
||||
if (cachedToken) return cachedToken;
|
||||
|
||||
const tokenPath = join(DATA_DIR, TOKEN_FILENAME);
|
||||
|
||||
if (existsSync(tokenPath)) {
|
||||
const token = readFileSync(tokenPath, 'utf-8').trim();
|
||||
if (token.length >= 32) {
|
||||
cachedToken = token;
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate new 32-byte hex token
|
||||
const token = randomBytes(32).toString('hex');
|
||||
mkdirSync(DATA_DIR, { recursive: true });
|
||||
writeFileSync(tokenPath, token, { mode: 0o600 });
|
||||
cachedToken = token;
|
||||
return token;
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import { logger } from "../utils/logger.js";
|
||||
import { HOOK_TIMEOUTS, getTimeout } from "./hook-constants.js";
|
||||
import { SettingsDefaultsManager } from "./SettingsDefaultsManager.js";
|
||||
import { MARKETPLACE_ROOT } from "./paths.js";
|
||||
import { getAuthToken } from "./auth-token.js";
|
||||
|
||||
// Named constants for health checks
|
||||
// Allow env var override for users on slow systems (e.g., CLAUDE_MEM_HEALTH_TIMEOUT_MS=10000)
|
||||
@@ -113,13 +112,9 @@ export function workerHttpRequest(
|
||||
|
||||
const url = buildWorkerUrl(apiPath);
|
||||
const init: RequestInit = { method };
|
||||
// Inject bearer token for worker API auth (#1932/#1933)
|
||||
// Merge caller headers first, then set Authorization last to prevent override
|
||||
const authHeaders: Record<string, string> = {
|
||||
...options.headers,
|
||||
'Authorization': `Bearer ${getAuthToken()}`
|
||||
};
|
||||
init.headers = authHeaders;
|
||||
if (options.headers) {
|
||||
init.headers = options.headers;
|
||||
}
|
||||
if (options.body) {
|
||||
init.body = options.body;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user