fix: address 10 unresolved PR review threads
- README: add language specifier to fenced code block - paths.ts: guard npmPackageRootDirectory() against bundle structure drift - OpenCodeInstaller: resolve bundle from import.meta.url, not process.cwd() - OpenCodeInstaller: log warnings on AGENTS.md injection failures - WindsurfHooksInstaller: key registry by full workspace path, not basename - uninstall.ts: poll health endpoint to wait for worker exit before file deletion - uninstall.ts: call IDE-specific uninstallers (Gemini, Windsurf, OpenCode, OpenClaw, Codex) - opencode-plugin: cap session tracking Map at 1000 entries with LRU eviction - GeminiCliHooksInstaller: document intentional JSON double-escaping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -165,8 +165,19 @@ async function workerGetText(path: string): Promise<string | null> {
|
||||
|
||||
const contentSessionIdsByOpenCodeSessionId = new Map<string, string>();
|
||||
|
||||
const MAX_SESSION_MAP_ENTRIES = 1000;
|
||||
|
||||
function getOrCreateContentSessionId(openCodeSessionId: string): string {
|
||||
if (!contentSessionIdsByOpenCodeSessionId.has(openCodeSessionId)) {
|
||||
// Evict oldest entries when the map exceeds the cap (Map preserves insertion order)
|
||||
while (contentSessionIdsByOpenCodeSessionId.size >= MAX_SESSION_MAP_ENTRIES) {
|
||||
const oldestKey = contentSessionIdsByOpenCodeSessionId.keys().next().value;
|
||||
if (oldestKey !== undefined) {
|
||||
contentSessionIdsByOpenCodeSessionId.delete(oldestKey);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
contentSessionIdsByOpenCodeSessionId.set(
|
||||
openCodeSessionId,
|
||||
`opencode-${openCodeSessionId}-${Date.now()}`,
|
||||
|
||||
Reference in New Issue
Block a user