Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/cli/src/__tests__/runtime-host-run-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ describe('Runtime Host maka run adapter', () => {
const prepareStarted = deferred<void>();
const fixture = runFixture({
graph: true,
strictTurnStopInput: true,
prepareGate: prepareGate.promise,
onPrepareStarted: () => prepareStarted.resolve(),
});
Expand Down Expand Up @@ -868,6 +869,7 @@ function runFixture(input: {
onGraphStop?: () => void;
initialMessages?: StoredMessage[];
finalMessages?: StoredMessage[];
strictTurnStopInput?: boolean;
}) {
const switches: string[] = [];
const moves: string[] = [];
Expand Down Expand Up @@ -1008,6 +1010,13 @@ function runFixture(input: {
return { rootSessionId: requestInput.rootSessionId, graphId: 'graph-1' };
}
if (operation === 'turn.stop') {
if (input.strictTurnStopInput) {
const allowed = new Set(['sessionId', 'turnId', 'runId']);
const unexpected = Object.keys(requestInput).filter((key) => !allowed.has(key));
if (unexpected.length > 0) {
throw new Error(`Unknown turn.stop input field: ${unexpected.join(', ')}`);
}
}
exactTurnStops.push({
sessionId: String(requestInput.sessionId),
turnId: String(requestInput.turnId),
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/runtime-host-run-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,11 @@ class RuntimeHostRunRuntime implements MakaRunRuntime {
}

async #stopTurn(turn: { sessionId: string; turnId: string; runId: string }): Promise<void> {
await this.#connection.request('turn.stop', turn);
await this.#connection.request('turn.stop', {
sessionId: turn.sessionId,
turnId: turn.turnId,
runId: turn.runId,
});
}

async #stopGraph(sessionId: string): Promise<void> {
Expand Down