Merge pull request #2512 from pikasTech/fix/nonblocking-service-contract-warning
Pipelines as Code CI / hwlab-nc01-v03-ci-poll- Success
Pipelines as Code CI / hwlab-nc01-v03-ci-poll- Success
修复:发送规范 AgentRun 工作区引用
This commit is contained in:
@@ -1004,7 +1004,6 @@ function newSessionIdAfterEviction(baseSessionId, traceId) {
|
||||
|
||||
function buildAgentRunCreateRunInput({ params, env, traceId, backendProfile, sessionId, toolCapabilities = null }) {
|
||||
const commitId = requireAgentRunSourceCommit(env);
|
||||
const runtimeAuthority = requireAgentRunRuntimeAuthority(env);
|
||||
const threadId = safeOpaqueId(params.threadId);
|
||||
const hwlabProjectId = firstNonEmpty(params.projectId);
|
||||
rejectRemovedResourceWorkspaceFiles(params.workspaceFiles ?? params.resourceWorkspaceFiles);
|
||||
@@ -1022,11 +1021,7 @@ function buildAgentRunCreateRunInput({ params, env, traceId, backendProfile, ses
|
||||
projectId: agentRunProjectIdForEnv(env),
|
||||
workspaceRef: {
|
||||
kind: "opaque",
|
||||
repo: DEFAULT_PROJECT_ID,
|
||||
branch: firstNonEmpty(env.HWLAB_BOOT_REF, env.HWLAB_CODE_AGENT_AGENTRUN_BRANCH, defaultAgentRunBranchForRuntimeLane(runtimeAuthority.lane), "v0.2"),
|
||||
runtimeNamespace: runtimeAuthority.namespace,
|
||||
hwlabTraceId: traceId,
|
||||
valuesPrinted: false
|
||||
path: "."
|
||||
},
|
||||
sessionRef: {
|
||||
sessionId: sessionId ?? scopedAgentRunSessionIdForParams(params, traceId),
|
||||
@@ -1349,12 +1344,6 @@ function namespaceForAgentRunRuntimeLane(lane) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function defaultAgentRunBranchForRuntimeLane(lane) {
|
||||
const match = String(lane ?? "").match(/^v(\d+)$/u);
|
||||
if (!match) return null;
|
||||
return `v0.${Number.parseInt(match[1], 10)}`;
|
||||
}
|
||||
|
||||
function agentRunRuntimeAuthorityError(code, message) {
|
||||
return Object.assign(new Error(message), {
|
||||
code,
|
||||
|
||||
@@ -54,6 +54,9 @@ test("fresh gpt.pika turn returns running only after durable dispatch intent is
|
||||
assert.equal(result.agentRun.durableDispatch, true);
|
||||
assert.equal(result.agentRun.status, "dispatch-intent-pending");
|
||||
|
||||
const runCall = calls.find((call) => call.path === "/api/v1/runs");
|
||||
assert.ok(runCall);
|
||||
assert.deepEqual(runCall.body.workspaceRef, { kind: "opaque", path: "." });
|
||||
const commandCall = calls.find((call) => call.path.endsWith("/commands"));
|
||||
assert.ok(commandCall);
|
||||
assert.equal(commandCall.body.idempotencyKey, traceId);
|
||||
|
||||
@@ -647,8 +647,7 @@ test("cloud api /v1/agent/chat delegates v0.3 turns to AgentRun v0.1 over adapte
|
||||
assert.equal(body.tenantId, "hwlab");
|
||||
assert.equal(body.projectId, "pikasTech/HWLAB");
|
||||
assert.equal(body.backendProfile, "deepseek");
|
||||
assert.equal(body.workspaceRef.branch, "v0.3");
|
||||
assert.equal(body.workspaceRef.runtimeNamespace, "hwlab-v03");
|
||||
assert.deepEqual(body.workspaceRef, { kind: "opaque", path: "." });
|
||||
assert.equal(body.resourceBundleRef.repoUrl, "http://git-mirror-http.devops-infra.svc.cluster.local/pikasTech/HWLAB.git");
|
||||
assert.equal(body.resourceBundleRef.commitId, "0123456789abcdef0123456789abcdef01234567");
|
||||
assert.equal(body.resourceBundleRef.kind, "gitbundle");
|
||||
|
||||
Reference in New Issue
Block a user