earendil-works/pi · error · PiServerError

not_found

not_found

Error message

Unknown session: ${sessionId}

What it means

Error "Unknown session: ${sessionId}" thrown in earendil-works/pi.

Source

Thrown at packages/server/src/testing/service.ts:233

			updatedAt: snapshot.updatedAt,
			sessionName: snapshot.name,
			cwd: snapshot.cwd,
		}));
	}

	async listModels(): Promise<ModelMetadata[]> {
		return [TEST_MODEL];
	}

	async createSession(options: CreateSessionOptions): Promise<PiSessionRuntime> {
		this.lastCreatedId = options.id;
		if (this.sessions.has(options.id)) throw new PiServerError("session_locked", "Session already exists");
		this.seed(options.id, options.name, options.cwd, options.model, options.thinkingLevel);
		return this.acquire(options.id);
	}

	async openSession(sessionId: string): Promise<PiSessionRuntime> {
		if (!this.sessions.has(sessionId)) throw new PiServerError("not_found", `Unknown session: ${sessionId}`);
		if (this.locked.has(sessionId)) throw new PiServerError("session_locked", `Session is locked: ${sessionId}`);
		return this.acquire(sessionId);
	}

	seed(
		id = "session-1",
		name = `Session ${id}`,
		cwd = "/tmp/pi-server-conformance",
		model: ModelRef = { provider: TEST_MODEL.provider, id: TEST_MODEL.id },
		thinkingLevel: ThinkingLevel = "off",
	): void {
		this.sessions.set(id, {
			snapshot: {
				id,
				name,
				cwd,
				createdAt: 1,
				updatedAt: 1,

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Create the session first or verify the sessionId.

When it happens

Trigger: Thrown at packages/server/src/testing/service.ts:233 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/f826cec2673f48e9. Report an issue: GitHub.