@testchimp/cli 0.1.77 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chimphands/run.js +6 -0
- package/dist/core/tools.js +12 -3
- package/package.json +1 -1
package/dist/chimphands/run.js
CHANGED
|
@@ -1105,6 +1105,10 @@ function writeOpencodeConfig(backend, apiKey, boot, llmBaseOverride) {
|
|
|
1105
1105
|
TESTCHIMP_EXECUTION_SOURCE: "CLOUD_AGENT",
|
|
1106
1106
|
CHIMPHANDS_UI_ATTACHED: uiAttached ? "true" : "false",
|
|
1107
1107
|
};
|
|
1108
|
+
if (sessionId) {
|
|
1109
|
+
mcpEnv.SESSION_ID = sessionId;
|
|
1110
|
+
mcpEnv.CHIMPHANDS_SESSION_ID = sessionId;
|
|
1111
|
+
}
|
|
1108
1112
|
const serviceUserId = bootStr(boot, "chimphands_service_account_user_id", "chimphandsServiceAccountUserId");
|
|
1109
1113
|
if (serviceUserId) {
|
|
1110
1114
|
mcpEnv.TESTCHIMP_USER_ID = serviceUserId;
|
|
@@ -2192,6 +2196,8 @@ export async function runChimphands(opts) {
|
|
|
2192
2196
|
TESTCHIMP_API_KEY: apiKey,
|
|
2193
2197
|
TESTCHIMP_BACKEND_URL: backend,
|
|
2194
2198
|
TESTCHIMP_EXECUTION_SOURCE: "CLOUD_AGENT",
|
|
2199
|
+
SESSION_ID: sessionId,
|
|
2200
|
+
CHIMPHANDS_SESSION_ID: sessionId,
|
|
2195
2201
|
};
|
|
2196
2202
|
if (userId)
|
|
2197
2203
|
childEnv.TESTCHIMP_USER_ID = userId;
|
package/dist/core/tools.js
CHANGED
|
@@ -1045,8 +1045,13 @@ export const TOOL_DEFINITIONS = [
|
|
|
1045
1045
|
inputSchema: S.reportAgentActionInput,
|
|
1046
1046
|
execute: async (args, { postMcp }) => {
|
|
1047
1047
|
const a = args;
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1048
|
+
const sessionId = (process.env.SESSION_ID ||
|
|
1049
|
+
process.env.CHIMPHANDS_SESSION_ID ||
|
|
1050
|
+
"").trim();
|
|
1051
|
+
const actorRaw = (a.actorType ?? (sessionId ? "cloud-agent" : "local-agent")).toString();
|
|
1052
|
+
const actorType = actorRaw.toUpperCase().replace(/-/g, "_") === "CLOUD_AGENT" || sessionId
|
|
1053
|
+
? "CLOUD_AGENT"
|
|
1054
|
+
: "LOCAL_AGENT";
|
|
1050
1055
|
const actionNorm = a.actionType.toString().toUpperCase().replace(/-/g, "_");
|
|
1051
1056
|
let actionType = actionNorm;
|
|
1052
1057
|
if (actionNorm === "COMPLETED" || actionNorm === "ACTION_COMPLETED") {
|
|
@@ -1062,6 +1067,8 @@ export const TOOL_DEFINITIONS = [
|
|
|
1062
1067
|
actorType,
|
|
1063
1068
|
entityType: a.entityType,
|
|
1064
1069
|
};
|
|
1070
|
+
if (sessionId)
|
|
1071
|
+
body.chimphandsSessionId = sessionId;
|
|
1065
1072
|
if (a.policyFile)
|
|
1066
1073
|
body.policyFile = a.policyFile;
|
|
1067
1074
|
if (a.policyVersion)
|
|
@@ -1071,8 +1078,10 @@ export const TOOL_DEFINITIONS = [
|
|
|
1071
1078
|
body.gitSha = gitSha;
|
|
1072
1079
|
if (a.userId)
|
|
1073
1080
|
body.userId = a.userId;
|
|
1074
|
-
else if (process.env.TESTCHIMP_USER_ID)
|
|
1081
|
+
else if (!sessionId && process.env.TESTCHIMP_USER_ID) {
|
|
1082
|
+
// ChimpHands: server resolves responsible user from SESSION_ID; do not stamp service account.
|
|
1075
1083
|
body.userId = process.env.TESTCHIMP_USER_ID;
|
|
1084
|
+
}
|
|
1076
1085
|
if (a.branchName)
|
|
1077
1086
|
body.branchName = a.branchName;
|
|
1078
1087
|
// Nested traceability wins for agentModel / skillVersion / cliVersion;
|
package/package.json
CHANGED