feat: mirror boss messages via app server
This commit is contained in:
@@ -508,6 +508,50 @@ test("codex app-server runner resumes a thread and collects streamed agent text"
|
||||
assert.equal(result.transport, "stdio");
|
||||
});
|
||||
|
||||
test("codex app-server runner injects Boss user message into the target Codex thread before starting a turn", async () => {
|
||||
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_ECHO_INJECTED_USER_MESSAGE;
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_ECHO_INJECTED_USER_MESSAGE = "1";
|
||||
try {
|
||||
const runnerConfig = getCodexAppServerRunnerConfig(process.env, {
|
||||
codexAppServerEnabled: true,
|
||||
codexAppServerCommand: process.execPath,
|
||||
codexAppServerArgs: ["tests/fixtures/codex-app-server-runtime.mjs"],
|
||||
codexAppServerWorkdir: repoRoot,
|
||||
codexAppServerTimeoutMs: 5000,
|
||||
masterAgentModel: "gpt-5.4",
|
||||
});
|
||||
const task = {
|
||||
taskId: "task-app-server-sync-user-message",
|
||||
taskType: "conversation_reply",
|
||||
targetCodexThreadRef: "019d-app-server-thread",
|
||||
targetCodexFolderRef: repoRoot,
|
||||
executionPrompt: "请修复登录页跳转问题",
|
||||
mirrorBossUserMessageToCodexDesktop: true,
|
||||
userMessageId: "boss-msg-1",
|
||||
sourceMessageId: "boss-msg-1",
|
||||
sourceMessageBody: "请修复登录页跳转问题",
|
||||
userDisplayName: "你",
|
||||
};
|
||||
|
||||
const result = await executeCodexAppServerTask(runnerConfig, task);
|
||||
|
||||
assert.equal(result.status, "completed");
|
||||
assert.equal(result.threadId, "019d-app-server-thread");
|
||||
assert.equal(result.turnControl, "start");
|
||||
assert.equal(result.threadHistorySync?.threadId, "019d-app-server-thread");
|
||||
assert.equal(result.threadHistorySync?.injectedItemCount, 1);
|
||||
assert.equal(result.threadHistorySync?.source, "boss_user_message");
|
||||
assert.match(result.replyBody, /INJECTED_USER_MESSAGE:请修复登录页跳转问题/);
|
||||
assert.doesNotMatch(JSON.stringify(result), /boss-msg-1/);
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env.BOSS_CODEX_APP_SERVER_FIXTURE_ECHO_INJECTED_USER_MESSAGE;
|
||||
} else {
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_ECHO_INJECTED_USER_MESSAGE = previous;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("codex app-server runner converts protocol progress events into Boss execution progress", async () => {
|
||||
const previous = process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_PROGRESS;
|
||||
process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_PROGRESS = "1";
|
||||
|
||||
Reference in New Issue
Block a user