mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:30:44 +00:00
chore: remove unrelated check-triage changes
This commit is contained in:
@@ -594,7 +594,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
public let timeout: Int?
|
||||
public let besteffortdeliver: Bool?
|
||||
public let lane: String?
|
||||
public let cleanupbundlemcponrunend: Bool?
|
||||
public let extrasystemprompt: String?
|
||||
public let bootstrapcontextmode: AnyCodable?
|
||||
public let bootstrapcontextrunkind: AnyCodable?
|
||||
@@ -626,7 +625,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
timeout: Int?,
|
||||
besteffortdeliver: Bool?,
|
||||
lane: String?,
|
||||
cleanupbundlemcponrunend: Bool?,
|
||||
extrasystemprompt: String?,
|
||||
bootstrapcontextmode: AnyCodable?,
|
||||
bootstrapcontextrunkind: AnyCodable?,
|
||||
@@ -657,7 +655,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
self.timeout = timeout
|
||||
self.besteffortdeliver = besteffortdeliver
|
||||
self.lane = lane
|
||||
self.cleanupbundlemcponrunend = cleanupbundlemcponrunend
|
||||
self.extrasystemprompt = extrasystemprompt
|
||||
self.bootstrapcontextmode = bootstrapcontextmode
|
||||
self.bootstrapcontextrunkind = bootstrapcontextrunkind
|
||||
@@ -690,7 +687,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
case timeout
|
||||
case besteffortdeliver = "bestEffortDeliver"
|
||||
case lane
|
||||
case cleanupbundlemcponrunend = "cleanupBundleMcpOnRunEnd"
|
||||
case extrasystemprompt = "extraSystemPrompt"
|
||||
case bootstrapcontextmode = "bootstrapContextMode"
|
||||
case bootstrapcontextrunkind = "bootstrapContextRunKind"
|
||||
|
||||
@@ -594,7 +594,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
public let timeout: Int?
|
||||
public let besteffortdeliver: Bool?
|
||||
public let lane: String?
|
||||
public let cleanupbundlemcponrunend: Bool?
|
||||
public let extrasystemprompt: String?
|
||||
public let bootstrapcontextmode: AnyCodable?
|
||||
public let bootstrapcontextrunkind: AnyCodable?
|
||||
@@ -626,7 +625,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
timeout: Int?,
|
||||
besteffortdeliver: Bool?,
|
||||
lane: String?,
|
||||
cleanupbundlemcponrunend: Bool?,
|
||||
extrasystemprompt: String?,
|
||||
bootstrapcontextmode: AnyCodable?,
|
||||
bootstrapcontextrunkind: AnyCodable?,
|
||||
@@ -657,7 +655,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
self.timeout = timeout
|
||||
self.besteffortdeliver = besteffortdeliver
|
||||
self.lane = lane
|
||||
self.cleanupbundlemcponrunend = cleanupbundlemcponrunend
|
||||
self.extrasystemprompt = extrasystemprompt
|
||||
self.bootstrapcontextmode = bootstrapcontextmode
|
||||
self.bootstrapcontextrunkind = bootstrapcontextrunkind
|
||||
@@ -690,7 +687,6 @@ public struct AgentParams: Codable, Sendable {
|
||||
case timeout
|
||||
case besteffortdeliver = "bestEffortDeliver"
|
||||
case lane
|
||||
case cleanupbundlemcponrunend = "cleanupBundleMcpOnRunEnd"
|
||||
case extrasystemprompt = "extraSystemPrompt"
|
||||
case bootstrapcontextmode = "bootstrapContextMode"
|
||||
case bootstrapcontextrunkind = "bootstrapContextRunKind"
|
||||
|
||||
@@ -152,7 +152,6 @@ export const AgentParamsSchema = Type.Object(
|
||||
timeout: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
bestEffortDeliver: Type.Optional(Type.Boolean()),
|
||||
lane: Type.Optional(Type.String()),
|
||||
cleanupBundleMcpOnRunEnd: Type.Optional(Type.Boolean()),
|
||||
extraSystemPrompt: Type.Optional(Type.String()),
|
||||
bootstrapContextMode: Type.Optional(
|
||||
Type.Union([Type.Literal("full"), Type.Literal("lightweight")]),
|
||||
|
||||
@@ -241,32 +241,6 @@ const options: ExecOptions = { timeout: 5000 };
|
||||
expect(findings.some((f) => f.ruleId === "dangerous-exec")).toBe(false);
|
||||
});
|
||||
|
||||
it("does not flag the qa-matrix argv-only self-reexec as shell command execution", () => {
|
||||
const source = `
|
||||
import { spawn } from "node:child_process";
|
||||
const child = spawn(process.execPath, [distEntryPath, ...params.args], {
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
});
|
||||
`;
|
||||
const findings = scanSource(
|
||||
source,
|
||||
path.resolve(
|
||||
process.cwd(),
|
||||
"extensions/qa-matrix/src/runners/contract/scenario-runtime-cli.ts",
|
||||
),
|
||||
);
|
||||
expect(findings.some((f) => f.ruleId === "dangerous-exec")).toBe(false);
|
||||
});
|
||||
|
||||
it("still flags plugin self-reexec as shell command execution", () => {
|
||||
const source = `
|
||||
import { spawn } from "node:child_process";
|
||||
const child = spawn(process.execPath, userControlledArgs, { shell: true });
|
||||
`;
|
||||
const findings = scanSource(source, "plugin.ts");
|
||||
expect(findings.some((f) => f.ruleId === "dangerous-exec")).toBe(true);
|
||||
});
|
||||
|
||||
it("returns empty array for clean plugin code", () => {
|
||||
const source = `
|
||||
export function greet(name: string): string {
|
||||
|
||||
@@ -216,28 +216,6 @@ function truncateEvidence(evidence: string, maxLen = 120): string {
|
||||
return `${evidence.slice(0, maxLen)}…`;
|
||||
}
|
||||
|
||||
function isAllowedNodeSelfReexec(filePath: string, line: string): boolean {
|
||||
if (
|
||||
path.resolve(filePath) !==
|
||||
path.resolve(
|
||||
process.cwd(),
|
||||
"extensions",
|
||||
"qa-matrix",
|
||||
"src",
|
||||
"runners",
|
||||
"contract",
|
||||
"scenario-runtime-cli.ts",
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
// Spawning the current Node executable with an argv array is not shell
|
||||
// execution. Keep direct shell/process launches blocked below.
|
||||
return /\bspawn\s*\(\s*process\.execPath\s*,\s*\[\s*distEntryPath\s*,\s*\.{3}params\.args\s*\]/.test(
|
||||
line,
|
||||
);
|
||||
}
|
||||
|
||||
export function scanSource(source: string, filePath: string): SkillScanFinding[] {
|
||||
const findings: SkillScanFinding[] = [];
|
||||
const lines = source.split("\n");
|
||||
@@ -260,9 +238,6 @@ export function scanSource(source: string, filePath: string): SkillScanFinding[]
|
||||
if (!match) {
|
||||
continue;
|
||||
}
|
||||
if (rule.ruleId === "dangerous-exec" && isAllowedNodeSelfReexec(filePath, line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Special handling for suspicious-network: check port
|
||||
if (rule.ruleId === "suspicious-network") {
|
||||
|
||||
Reference in New Issue
Block a user