vibe-coding-master 0.3.8 → 0.3.9
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.
|
@@ -147,28 +147,17 @@ export function createSessionService(deps) {
|
|
|
147
147
|
if (!record) {
|
|
148
148
|
return undefined;
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
if (!runtimeSession) {
|
|
152
|
-
return {
|
|
153
|
-
...record,
|
|
154
|
-
status: getRecoverableStatus(record),
|
|
155
|
-
pid: undefined,
|
|
156
|
-
exitCode: record.exitCode ?? null
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
...record,
|
|
161
|
-
status: runtimeSession.status,
|
|
162
|
-
activityStatus: record.activityStatus ?? "idle",
|
|
163
|
-
pid: runtimeSession.pid,
|
|
164
|
-
lastOutputAt: runtimeSession.lastOutputAt,
|
|
165
|
-
exitCode: runtimeSession.exitCode
|
|
166
|
-
};
|
|
150
|
+
return toRoleSessionRecordView(record, deps.runtime);
|
|
167
151
|
},
|
|
168
152
|
async listRoleSessions(repoRoot, taskSlug) {
|
|
169
153
|
const sessions = [];
|
|
154
|
+
const config = await deps.projectService.loadConfig(repoRoot);
|
|
155
|
+
const task = await deps.taskService.loadTask(repoRoot, taskSlug);
|
|
156
|
+
const taskRepoRoot = getTaskRuntimeRepoRoot(task);
|
|
157
|
+
const persistedTaskSession = await loadPersistedTaskSessionRecord(deps.fs, taskRepoRoot, config.stateRoot, taskSlug);
|
|
170
158
|
for (const role of ROLE_NAMES) {
|
|
171
|
-
const session =
|
|
159
|
+
const session = toRoleSessionRecordView(deps.registry.getByRole(taskSlug, role)
|
|
160
|
+
?? normalizePersistedRoleRecord(persistedTaskSession?.roles[role]?.record), deps.runtime);
|
|
172
161
|
if (session) {
|
|
173
162
|
sessions.push(session);
|
|
174
163
|
}
|
|
@@ -248,6 +237,28 @@ export function createSessionService(deps) {
|
|
|
248
237
|
}
|
|
249
238
|
};
|
|
250
239
|
}
|
|
240
|
+
function toRoleSessionRecordView(record, runtime) {
|
|
241
|
+
if (!record) {
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
const runtimeSession = runtime.getSession(record.id);
|
|
245
|
+
if (!runtimeSession) {
|
|
246
|
+
return {
|
|
247
|
+
...record,
|
|
248
|
+
status: getRecoverableStatus(record),
|
|
249
|
+
pid: undefined,
|
|
250
|
+
exitCode: record.exitCode ?? null
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
...record,
|
|
255
|
+
status: runtimeSession.status,
|
|
256
|
+
activityStatus: record.activityStatus ?? "idle",
|
|
257
|
+
pid: runtimeSession.pid,
|
|
258
|
+
lastOutputAt: runtimeSession.lastOutputAt,
|
|
259
|
+
exitCode: runtimeSession.exitCode
|
|
260
|
+
};
|
|
261
|
+
}
|
|
251
262
|
async function buildCodexReviewerStartCommand(fs, taskRepoRoot, launchMode, selectedModel, selectedEffort) {
|
|
252
263
|
const codexDir = resolveRepoPath(taskRepoRoot, CODEX_DIR);
|
|
253
264
|
const reviewDir = resolveRepoPath(taskRepoRoot, CODEX_REVIEW_DIR);
|
|
@@ -322,12 +333,17 @@ function getHandoffArtifactPath(paths, role) {
|
|
|
322
333
|
return undefined;
|
|
323
334
|
}
|
|
324
335
|
async function loadPersistedRoleRecord(fs, repoRoot, stateRoot, taskSlug, role) {
|
|
336
|
+
const current = await loadPersistedTaskSessionRecord(fs, repoRoot, stateRoot, taskSlug);
|
|
337
|
+
return normalizePersistedRoleRecord(current?.roles[role]?.record);
|
|
338
|
+
}
|
|
339
|
+
async function loadPersistedTaskSessionRecord(fs, repoRoot, stateRoot, taskSlug) {
|
|
325
340
|
const sessionPath = getTaskSessionPath(repoRoot, stateRoot, taskSlug);
|
|
326
341
|
if (!(await fs.pathExists(sessionPath))) {
|
|
327
342
|
return undefined;
|
|
328
343
|
}
|
|
329
|
-
|
|
330
|
-
|
|
344
|
+
return fs.readJson(sessionPath);
|
|
345
|
+
}
|
|
346
|
+
function normalizePersistedRoleRecord(record) {
|
|
331
347
|
const legacy = record;
|
|
332
348
|
return record
|
|
333
349
|
? {
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
+
import { DISPATCHABLE_ROLES, ROLE_NAMES } from "../../shared/constants.js";
|
|
2
|
+
import { isOpenFileLimitError } from "../errors.js";
|
|
1
3
|
import { getTaskRuntimeRepoRoot } from "./task-service.js";
|
|
2
4
|
export function createStatusService(deps) {
|
|
3
5
|
return {
|
|
4
6
|
async getTaskStatus(repoRoot, taskSlug) {
|
|
5
7
|
const task = await deps.taskService.loadTask(repoRoot, taskSlug);
|
|
6
8
|
const taskRepoRoot = getTaskRuntimeRepoRoot(task);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const warnings = [];
|
|
10
|
+
let artifacts;
|
|
11
|
+
let sessions = [];
|
|
12
|
+
try {
|
|
13
|
+
artifacts = await deps.artifactService.listArtifacts({
|
|
14
|
+
repoRoot: taskRepoRoot,
|
|
15
|
+
handoffDir: task.handoffDir
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (!isOpenFileLimitError(error)) {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
artifacts = degradedArtifactSummary(task.handoffDir);
|
|
23
|
+
warnings.push(`Artifacts are temporarily unavailable because the backend hit the open-files limit: ${errorMessage(error)}`);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
sessions = await deps.sessionService.listRoleSessions(repoRoot, taskSlug);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (!isOpenFileLimitError(error)) {
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
warnings.push(`Role sessions are temporarily unavailable because the backend hit the open-files limit: ${errorMessage(error)}`);
|
|
33
|
+
}
|
|
34
|
+
warnings.push(...artifacts.checks
|
|
13
35
|
.filter((check) => check.status !== "ok")
|
|
14
|
-
.map((check) => `${check.path}: ${check.status}`);
|
|
36
|
+
.map((check) => `${check.path}: ${check.status}`));
|
|
15
37
|
return {
|
|
16
38
|
task,
|
|
17
39
|
sessions,
|
|
@@ -21,3 +43,28 @@ export function createStatusService(deps) {
|
|
|
21
43
|
}
|
|
22
44
|
};
|
|
23
45
|
}
|
|
46
|
+
function degradedArtifactSummary(handoffDir) {
|
|
47
|
+
const roleCommandsDir = `${handoffDir}/role-commands`;
|
|
48
|
+
const logsDir = `${handoffDir}/logs`;
|
|
49
|
+
const messagesDir = `${handoffDir}/messages`;
|
|
50
|
+
return {
|
|
51
|
+
paths: {
|
|
52
|
+
handoffDir,
|
|
53
|
+
roleCommandsDir,
|
|
54
|
+
logsDir,
|
|
55
|
+
messagesDir,
|
|
56
|
+
roleCommandPaths: Object.fromEntries(DISPATCHABLE_ROLES.map((role) => [role, `${roleCommandsDir}/${role}.md`])),
|
|
57
|
+
roleLogPaths: Object.fromEntries(ROLE_NAMES.map((role) => [role, `${logsDir}/${role}.log`])),
|
|
58
|
+
messageRoutePaths: {},
|
|
59
|
+
architecturePlanPath: `${handoffDir}/architecture-plan.md`,
|
|
60
|
+
knownIssuesPath: `${handoffDir}/known-issues.md`,
|
|
61
|
+
reviewReportPath: `${handoffDir}/review-report.md`,
|
|
62
|
+
docsSyncReportPath: `${handoffDir}/docs-sync-report.md`,
|
|
63
|
+
finalAcceptancePath: `${handoffDir}/final-acceptance.md`
|
|
64
|
+
},
|
|
65
|
+
checks: []
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function errorMessage(error) {
|
|
69
|
+
return error instanceof Error ? error.message : String(error);
|
|
70
|
+
}
|