earendil-works/pi · error · SessionError

storage

storage

Error message

Lane ${newRecord.lane} already has an open operation ${currentOpenOperationId}

What it means

Error "Lane ${newRecord.lane} already has an open operation ${currentOpenOperationId}" thrown in earendil-works/pi.

Source

Thrown at packages/agent/src/harness/session/memory.ts:77

	async appendEntry<TEntry extends Entry>(newEntry: ProvisionedEntry<TEntry>, lane: string): Promise<TEntry> {
		const parentId = this.state.requireLane(lane);
		this.state.validateUnusedId(newEntry.id);
		const entry = {
			...structuredClone(newEntry),
			parentId,
			seq: this.state.nextSequence,
			timestamp: Date.now(),
		} as unknown as TEntry;
		this.state.applyMutation({ kind: "entry", lane, entry });
		return structuredClone(entry);
	}

	async appendRecord<TRecord extends LaneRecord>(newRecord: NewRecord<TRecord>): Promise<TRecord> {
		this.state.requireLane(newRecord.lane);
		this.state.validateUnusedId(newRecord.id);
		const currentOpenOperationId = this.state.findOpenOperations(newRecord.lane, { limit: 1 })[0]?.id;
		if (newRecord.type === "operation_started" && currentOpenOperationId !== undefined) {
			throw new SessionError(
				"storage",
				`Lane ${newRecord.lane} already has an open operation ${currentOpenOperationId}`,
			);
		}
		const record = {
			...structuredClone(newRecord),
			seq: this.state.nextSequence,
			timestamp: Date.now(),
		} as unknown as TRecord;
		this.state.applyMutation({ kind: "record", record });
		return structuredClone(record);
	}

	async getEntry(id: string): Promise<Entry | undefined> {
		const entry = this.state.getEntry(id);
		return entry === undefined ? undefined : structuredClone(entry);
	}

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Close the open operation on that lane before starting a new one, or use a different lane.

When it happens

Trigger: Thrown at packages/agent/src/harness/session/memory.ts:77 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/4019b45c70c43e39. Report an issue: GitHub.