sequant 1.20.2 → 1.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,14 +23,15 @@ const PHASE_PROMPTS = {
|
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Phases that require worktree isolation.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Only `spec` runs in the main repo (planning-only, no file changes).
|
|
27
|
+
* All other phases must run in the worktree because:
|
|
28
|
+
* 1. They need to read/modify the worktree code
|
|
29
|
+
* 2. Resuming a session created in a different cwd crashes the SDK
|
|
30
30
|
*/
|
|
31
31
|
const ISOLATED_PHASES = [
|
|
32
32
|
"exec",
|
|
33
33
|
"security-review",
|
|
34
|
+
"testgen",
|
|
34
35
|
"test",
|
|
35
36
|
"qa",
|
|
36
37
|
"loop",
|
|
@@ -152,8 +153,12 @@ async function executePhase(issueNumber, phase, config, sessionId, worktreePath,
|
|
|
152
153
|
env.SEQUANT_ORCHESTRATOR = "sequant-run";
|
|
153
154
|
env.SEQUANT_PHASE = phase;
|
|
154
155
|
// Execute using Claude Agent SDK
|
|
155
|
-
//
|
|
156
|
-
|
|
156
|
+
// Safety: never resume a session when worktree isolation is active.
|
|
157
|
+
// Even if THIS phase doesn't use the worktree, a previous phase may have
|
|
158
|
+
// created the session there. Resuming from a different cwd crashes the SDK
|
|
159
|
+
// (exit code 1). ISOLATED_PHASES prevents this by design, but this guard
|
|
160
|
+
// catches edge cases (e.g. a new phase added without updating ISOLATED_PHASES).
|
|
161
|
+
const canResume = sessionId && !worktreePath;
|
|
157
162
|
// Get MCP servers config if enabled
|
|
158
163
|
// Reads from Claude Desktop config and passes to SDK for headless MCP support
|
|
159
164
|
const mcpServers = config.mcp ? getMcpServersConfig() : undefined;
|