fix: add agent field to readMetadata return mapping
readMetadata() was not returning the `agent` field even though writeMetadata() persisted it. This meant typed consumers got undefined for session.agent while raw readers worked fine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
46b0d1a541
commit
89fc3369d5
|
|
@ -303,6 +303,16 @@ describe("spawn", () => {
|
|||
expect(meta).not.toBeNull();
|
||||
expect(meta!["agent"]).toBe("mock-agent");
|
||||
});
|
||||
|
||||
it("readMetadata returns agent field (typed SessionMetadata)", async () => {
|
||||
const sm = createSessionManager({ config, registry: registryWithMultipleAgents });
|
||||
|
||||
await sm.spawn({ projectId: "my-app", agent: "codex" });
|
||||
|
||||
const meta = readMetadata(sessionsDir, "app-1");
|
||||
expect(meta).not.toBeNull();
|
||||
expect(meta!.agent).toBe("codex");
|
||||
});
|
||||
});
|
||||
|
||||
it("validates issue exists when issueId provided", async () => {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ export function readMetadata(dataDir: string, sessionId: SessionId): SessionMeta
|
|||
pr: raw["pr"],
|
||||
summary: raw["summary"],
|
||||
project: raw["project"],
|
||||
agent: raw["agent"],
|
||||
createdAt: raw["createdAt"],
|
||||
runtimeHandle: raw["runtimeHandle"],
|
||||
dashboardPort: raw["dashboardPort"] ? Number(raw["dashboardPort"]) : undefined,
|
||||
|
|
|
|||
Loading…
Reference in New Issue