The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
fix(plan-canvas): reconcile profile resolver and retain invalid feedback queues
haelyrae259e06c755f
diff --git a/scripts/hooks/plan-canvas-pending.js b/scripts/hooks/plan-canvas-pending.jsindex 63727e436..e0c0ad38d 100644--- a/scripts/hooks/plan-canvas-pending.js+++ b/scripts/hooks/plan-canvas-pending.js@@ -62,24 +62,6 @@ function claudeConfigDir() {return path.resolve(trimmed);}-// Resolve the Claude profile directory the same way everywhere.-//-// Duplicated rather than imported on purpose: hooks ship in managed installs-// that carry top-level `scripts/` without `scripts/lib/` (see #3259), so a-// require into lib/ would make the hook unloadable there. `~` is expanded the-// way `scripts/lib/agent-data-home.js` expands it, so a profile written as-// `~/.claude-work` resolves to one place rather than two.-function claudeConfigDir() {- const configured = process.env.CLAUDE_CONFIG_DIR;- const trimmed = configured ? String(configured).trim() : '';- if (!trimmed) return path.join(os.homedir(), '.claude');- if (trimmed.startsWith('~')) {- const remainder = trimmed.slice(1).replace(/^[/\\]+/, '');- return remainder ? path.join(os.homedir(), remainder) : os.homedir();- }- return path.resolve(trimmed);-}-function stateDir() {const override = process.env.ECC_PLAN_CANVAS_STATE_DIR;if (override && override.trim()) return path.resolve(override.trim());diff --git a/tests/hooks/plan-canvas-pending-hook.test.js b/tests/hooks/plan-canvas-pending-hook.test.jsindex ddf4b3977..0a3d82688 100644--- a/tests/hooks/plan-canvas-pending-hook.test.js+++ b/tests/hooks/plan-canvas-pending-hook.test.js@@ -278,7 +278,7 @@ async function runTests() {assert.strictEqual(await hook.drainViaServer(port, 'aaaaaaaaaaaa'), null);}fs.writeFileSync(path.join(stateDir, 'server.json'), JSON.stringify({ port: 4321 }));- for (const key of ['bad?key=SECRET&other=1', 'A'.repeat(12), 'a'.repeat(13), 'a'.repeat(100000), {}, null]) {+ for (const key of ['bad?key=SECRET&other=1', 'A'.repeat(12), 'a'.repeat(13), 'a'.repeat(12) + '\n', 'a'.repeat(12) + '\r\n', 'a'.repeat(100000), {}, null]) {writeState(stateDir, { aaaaaaaaaaaa: sessionRecord(key, artifact, [{ kind: 'chat', text: 'KEEP' }]) });const raw = JSON.stringify({ cwd: root });assert.strictEqual((await hook.run(raw)).stdout, raw);