Merge pull request #790 from pikasTech/fix-v02-cli-session-provider-profile-20260603

修复 v0.2 CLI 显式 session 默认 providerProfile
This commit is contained in:
Lyon
2026-06-04 00:29:13 +08:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -171,6 +171,7 @@ test("hwlab-cli client group help is visible and does not issue HTTP requests",
assert.equal(agent.payload.action, "client.agent.help");
assert.equal(agent.payload.serviceRuntime, false);
assert.ok(agent.payload.commands.some((command: string) => command.startsWith("send ")));
assert.ok(agent.payload.commands.some((command: string) => command.startsWith("send ") && command.includes("--provider-profile")));
const session = await runHwlabCli(["client", "session", "--help", "--base-url", "http://web.test"], { fetchImpl });
assert.equal(session.exitCode, 0);
@@ -561,7 +562,8 @@ test("hwlab-cli client agent send resolves explicit session conversation before
sessionId: "ses_stale_workspace",
threadId: "thread-stale-workspace"
},
workspace: { sessionStatus: "idle", threadId: "thread-stale-workspace" }
providerProfile: "deepseek",
workspace: { sessionStatus: "idle", threadId: "thread-stale-workspace", providerProfile: "deepseek" }
}
}), { status: 200 });
}
@@ -594,6 +596,7 @@ test("hwlab-cli client agent send resolves explicit session conversation before
assert.equal(calls[2].body.conversationId, "cnv_manual_current");
assert.equal(calls[2].body.sessionId, "ses_manual_current");
assert.equal(calls[2].body.threadId, "thread-manual-current");
assert.equal(calls[2].body.providerProfile, "minimax-m3");
assert.equal(calls[2].body.workspaceId, "wsp_stale_selection");
assert.equal(result.payload.continuation.conversationId, "cnv_manual_current");
assert.equal(result.payload.continuation.sessionId, "ses_manual_current");
+6 -2
View File
@@ -634,7 +634,7 @@ function agentHelp() {
"session select SESSION_ID [--workspace-id ID]",
"session status SESSION_ID",
"session list [--limit N]",
"send --message TEXT|--message-file PATH [--from-trace TRACE] [--conversation-id ID] [--session-id ID] [--thread-id ID] [--retry-of TRACE] [default: short return]",
"send --message TEXT|--message-file PATH [--from-trace TRACE] [--conversation-id ID] [--session-id ID] [--thread-id ID] [--retry-of TRACE] [--provider-profile deepseek|codex-api|minimax-m3] [default: short return]",
"composer status [--profile NAME] [--full]",
"composer submit --message TEXT|--message-file PATH [--profile NAME] [default: auto turn/steer]",
"send --message TEXT --wait [--timeout-ms N] [--poll-interval-ms N]",
@@ -1355,6 +1355,10 @@ async function agentSend(context: any) {
retryOf,
fromTrace: replay.fromTrace
});
const requestProviderProfile = text(parsed.providerProfile)
|| text(explicitSessionRecord?.providerProfile)
|| (workspaceMatchesSelectedSession ? text(workspaceState?.providerProfile) : "")
|| "deepseek";
const requestBody = clean({
message,
conversationId,
@@ -1362,7 +1366,7 @@ async function agentSend(context: any) {
threadId,
retryOf,
traceId,
providerProfile: text(parsed.providerProfile) || "deepseek",
providerProfile: requestProviderProfile,
gatewayShellTimeoutMs: numberOption(parsed.gatewayShellTimeoutMs),
shortConnection: true,
projectId: text(parsed.projectId) || DEFAULT_WORKBENCH_PROJECT_ID,