From 61558d794ae7271ad10e0393965e5302d990a155 Mon Sep 17 00:00:00 2001 From: bft-codebot Date: Thu, 7 May 2026 14:51:02 +0000 Subject: [PATCH] sync(bfmono): fix(gambit): remove task delegation host service methods (+19 more) (bfmono@11745a3db) This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit/packages/gambit-core/` - bfmono rev: 11745a3db Changes: - bd65fd7bc fix(gambit): remove task delegation host service methods - 5776f3e98 feat(workloop): route runtime work through host services - af2da504c chore(gambit): cut 1.0.0-rc.2 - 84f610a1d docs(workloop): align Gambit brand hierarchy - ca4aff086 chore(gambit): remove legacy desktop fallbacks - e281e27f1 fix(gambit): hydrate chat transcript from persisted state - 35438f961 chore(gambit): record full precommit verification - e88e4957e docs(gambit): reposition around scenarios and graders - 2d2691076 fix(gambit): reject sandboxed chat runs - 98ab911eb docs(gambit): use canonical graders frontmatter - bb582eeb6 feat(gambit): improve chat event observability - 43e0588ba feat(gambit): stream and control chat turns - 538d0ad1b feat(gambit): add local deck chat repro server - 60078d9f6 fix(workloop): disable Codex websockets in chief runtime - 93d44fb06 fix(gambit): preserve whitespace in streamed assistant deltas - 76e21a05f fix(workloop): preserve Codex auth refresh failures - 224cfdca6 fix(gambit): fall back without host service token - 668e393de feat(gambit): add browser introspection live commands - 4d8a6ad7b feat(workloop): bridge runtime Codex refresh to host services - 81ac0db58 feat(gambit): add live browser pointer refs Do not edit this repo directly; make changes in bfmono and re-run the sync. --- src/runtime_host_service.test.ts | 27 +++++----- src/runtime_host_service.ts | 85 -------------------------------- 2 files changed, 12 insertions(+), 100 deletions(-) diff --git a/src/runtime_host_service.test.ts b/src/runtime_host_service.test.ts index 164207b0..339234e6 100644 --- a/src/runtime_host_service.test.ts +++ b/src/runtime_host_service.test.ts @@ -4,7 +4,6 @@ import { join } from "@std/path"; import { callRuntimeHostServiceRaw, CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD, - DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD, validateRuntimeHostServiceMethodAndParams, } from "./runtime_host_service.ts"; @@ -44,7 +43,7 @@ Deno.test("runtime host-service raw calls return non-Codex host results unchange error: null, id: request.id, result: { - payload: { taskId: "workspace-delegation-smoke" }, + payload: { writebackId: "preview-smoke" }, status: 200, }, }) @@ -60,19 +59,18 @@ Deno.test("runtime host-service raw calls return non-Codex host results unchange try { const result = await callRuntimeHostServiceRaw({ - method: DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD, + method: CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD, params: { - targetCoworker: "assistant-to-chief-of-staff", - title: "Workspace delegation smoke", - purpose: "Verify host-owned task drafting.", - request: "Report the current working directory.", + changedPaths: ["README.md"], + summary: "Preview smoke.", + workspaceRoot: "/tmp/workspace", }, socketPath, token: "test-token", }); assertEquals(result, { - payload: { taskId: "workspace-delegation-smoke" }, + payload: { writebackId: "preview-smoke" }, status: 200, }); } finally { @@ -99,7 +97,7 @@ Deno.test("runtime host-service raw calls support TCP endpoints", async () => { error: null, id: request.id, result: { - payload: { taskId: "tcp-workspace-delegation-smoke" }, + payload: { writebackId: "tcp-preview-smoke" }, status: 200, }, }) @@ -115,19 +113,18 @@ Deno.test("runtime host-service raw calls support TCP endpoints", async () => { try { const result = await callRuntimeHostServiceRaw({ - method: DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD, + method: CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD, params: { - targetCoworker: "assistant-to-chief-of-staff", - title: "TCP workspace delegation smoke", - purpose: "Verify host-owned task drafting over TCP.", - request: "Report the current working directory.", + changedPaths: ["README.md"], + summary: "TCP preview smoke.", + workspaceRoot: "/tmp/workspace", }, socketPath: `tcp://127.0.0.1:${address.port}`, token: "test-token", }); assertEquals(result, { - payload: { taskId: "tcp-workspace-delegation-smoke" }, + payload: { writebackId: "tcp-preview-smoke" }, status: 200, }); } finally { diff --git a/src/runtime_host_service.ts b/src/runtime_host_service.ts index 35467939..15751daf 100644 --- a/src/runtime_host_service.ts +++ b/src/runtime_host_service.ts @@ -5,10 +5,6 @@ export const RUNTIME_HOST_SERVICE_TOKEN_ENV = export const CODEX_REFRESH_HOST_SERVICE_METHOD = "providerAuth.codex.refreshChatgptTokens"; -export const DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD = - "workloop.tasks.draftCoworkerTask"; -export const QUEUE_COWORKER_TASK_HOST_SERVICE_METHOD = - "workloop.tasks.queueCoworkerTask"; export const CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD = "workloop.writebacks.createPreview"; @@ -31,20 +27,6 @@ export type CodexRefreshHostServiceResult = { type: "chatgptAuthTokens"; }; -export type DraftCoworkerTaskHostServiceParams = { - targetCoworker: string; - taskId?: string | null; - title: string; - purpose: string; - request: string; - acceptanceCriteria?: Array; -}; - -export type QueueCoworkerTaskHostServiceParams = { - targetCoworker: string; - taskId: string; -}; - export type CreateWritebackPreviewHostServiceParams = { summary: string; workspaceRoot: string; @@ -53,14 +35,10 @@ export type CreateWritebackPreviewHostServiceParams = { export type RuntimeHostServiceMethod = | typeof CODEX_REFRESH_HOST_SERVICE_METHOD - | typeof DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD - | typeof QUEUE_COWORKER_TASK_HOST_SERVICE_METHOD | typeof CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD; export type RuntimeHostServiceParams = | CodexRefreshHostServiceParams - | DraftCoworkerTaskHostServiceParams - | QueueCoworkerTaskHostServiceParams | CreateWritebackPreviewHostServiceParams; export type RuntimeHostServiceRequest = { @@ -159,51 +137,6 @@ function normalizeStringArray(value: unknown, label: string): Array { }); } -export function validateDraftCoworkerTaskHostServiceParams( - value: unknown, -): DraftCoworkerTaskHostServiceParams { - if (!isRecord(value)) { - throw new Error("host service params must be a JSON object."); - } - const taskId = value.taskId == null - ? null - : normalizeOptionalString(value.taskId); - if (value.taskId != null && taskId == null) { - throw new Error( - "workloop.tasks.draftCoworkerTask taskId must be a non-empty string when provided.", - ); - } - return { - targetCoworker: normalizeRequiredString( - value.targetCoworker, - "targetCoworker", - ), - taskId, - title: normalizeRequiredString(value.title, "title"), - purpose: normalizeRequiredString(value.purpose, "purpose"), - request: normalizeRequiredString(value.request, "request"), - acceptanceCriteria: normalizeStringArray( - value.acceptanceCriteria, - "acceptanceCriteria", - ), - }; -} - -export function validateQueueCoworkerTaskHostServiceParams( - value: unknown, -): QueueCoworkerTaskHostServiceParams { - if (!isRecord(value)) { - throw new Error("host service params must be a JSON object."); - } - return { - targetCoworker: normalizeRequiredString( - value.targetCoworker, - "targetCoworker", - ), - taskId: normalizeRequiredString(value.taskId, "taskId"), - }; -} - export function validateCreateWritebackPreviewHostServiceParams( value: unknown, ): CreateWritebackPreviewHostServiceParams { @@ -228,14 +161,6 @@ export function validateRuntimeHostServiceMethodAndParams(input: { method: typeof CODEX_REFRESH_HOST_SERVICE_METHOD; params: CodexRefreshHostServiceParams; } - | { - method: typeof DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD; - params: DraftCoworkerTaskHostServiceParams; - } - | { - method: typeof QUEUE_COWORKER_TASK_HOST_SERVICE_METHOD; - params: QueueCoworkerTaskHostServiceParams; - } | { method: typeof CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD; params: CreateWritebackPreviewHostServiceParams; @@ -246,16 +171,6 @@ export function validateRuntimeHostServiceMethodAndParams(input: { method: CODEX_REFRESH_HOST_SERVICE_METHOD, params: validateCodexRefreshHostServiceParams(input.params), }; - case DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD: - return { - method: DRAFT_COWORKER_TASK_HOST_SERVICE_METHOD, - params: validateDraftCoworkerTaskHostServiceParams(input.params), - }; - case QUEUE_COWORKER_TASK_HOST_SERVICE_METHOD: - return { - method: QUEUE_COWORKER_TASK_HOST_SERVICE_METHOD, - params: validateQueueCoworkerTaskHostServiceParams(input.params), - }; case CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD: return { method: CREATE_WRITEBACK_PREVIEW_HOST_SERVICE_METHOD,