fix(plan-canvas): reconcile profile resolver and retain invalid feedback queues

This commit is contained in:
haelyra
2026-10-10 19:19:30 -04:00
parent 0b07708137
commit e259e06c75
2 changed files with 1 additions and 19 deletions
-18
View File
@@ -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());
+1 -1
View File
@@ -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);