138
throw new ProtocolError(JsonRpcErrorCodes.InvalidParams, `Operation '${params.operationId}' is disabled on changeset ${params.channel}`);
139
}
141
>
// Enforce the active-turn gate at invocation time too, independent of
142
>
// the advertised operation status. A ChangesetOperationStatusChanged
143
>
// action (e.g. a previously running operation finishing) can reset the
144
>
// status back to Idle while a chat turn is still streaming, which would
145
>
// otherwise re-enable invocation mid-turn and let the working tree /
146
>
// branch state be mutated.
147
>
const parsed = parseChangesetUri(params.channel);
148
if (parsed && this._stateManager.hasActiveTurn(parsed.sessionUri)) {
149
throw new ProtocolError(JsonRpcErrorCodes.InvalidParams, `Operation '${params.operationId}' is disabled while a turn is active on changeset ${params.channel}`);