Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

Merge pull request #216 from multica-ai/codex/meta-skill-installer-e2e-skills-benchmark

Jiayuan Zhange28ecb9a915d
diff --cc packages/core/src/agent/runner.ts
index a6bc117ae1,0b51292ad0..320e76f112
--- a/packages/core/src/agent/runner.ts
+++ b/packages/core/src/agent/runner.ts
@@@ -199,8 -290,14 +347,15 @@@ export class Agent
private readonly stderr: NodeJS.WritableStream;
private readonly runLog: RunLog;
private readonly toolStartTimes = new Map<string, number>();
+ private currentRunToolExecutions: ToolExecutionRecord[] = [];
private initialized = false;
+ private allowSkillInstallForCurrentRun = false;
+ private awaitingSkillInstallConfirmation = false;
+ private allowWorkaroundForCurrentRun = false;
+ private awaitingWorkaroundConfirmation = false;
+ private allowCustomSkillAuthoringForCurrentRun = false;
+ private awaitingCustomSkillAuthoringConfirmation = false;
+ private readonly guardedExecApproval: ExecApprovalCallback;
// Context window settings (for pre-flight compaction)
private readonly reserveTokens: number;
@@@ -583,8 -698,43 +756,44 @@@
this.currentUserSource = options?.source;
this._isRunning = true;
this._aborted = false;
+ this.currentRunToolExecutions = [];
+ if (this._internalRun) {
+ this.allowSkillInstallForCurrentRun = false;
+ this.allowWorkaroundForCurrentRun = false;
+ this.allowCustomSkillAuthoringForCurrentRun = false;
+ } else {
+ const consent = evaluateSkillInstallConsent(prompt, this.awaitingSkillInstallConfirmation);
+ if (consent.declined) {
+ this.awaitingSkillInstallConfirmation = false;
+ }
+ this.allowSkillInstallForCurrentRun = consent.allowInstall;
+ if (consent.allowInstall) {
+ this.awaitingSkillInstallConfirmation = false;
+ }
+
+ const workaroundConsent = evaluateWorkaroundConsent(prompt, this.awaitingWorkaroundConfirmation);
+ if (workaroundConsent.declined) {
+ this.awaitingWorkaroundConfirmation = false;
+ }
+ this.allowWorkaroundForCurrentRun = workaroundConsent.allowWorkaround;
+ if (workaroundConsent.allowWorkaround) {
+ this.awaitingWorkaroundConfirmation = false;
+ }
+
+ const customSkillConsent = evaluateCustomSkillAuthoringConsent(
+ prompt,
+ this.awaitingCustomSkillAuthoringConfirmation,
+ );
+ if (customSkillConsent.declined) {
+ this.awaitingCustomSkillAuthoringConfirmation = false;
+ }
+ this.allowCustomSkillAuthoringForCurrentRun = customSkillConsent.allowAuthoring;
+ if (customSkillConsent.allowAuthoring) {
+ this.awaitingCustomSkillAuthoringConfirmation = false;
+ }
+ }
+
const runStart = Date.now();
this.runLog.log("run_start", {
prompt: prompt.slice(0, 200),