Skip to content

Commit 8a9a526

Browse files
chore: sync actions from gh-aw@v0.74.3 (#104)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 23453ec commit 8a9a526

28 files changed

Lines changed: 1134 additions & 247 deletions

setup/js/action_conclusion_otlp.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function parseJobStartMs(raw) {
6565
}
6666

6767
/**
68-
* Send the OTLP job-conclusion span. Non-fatal: all errors are silently
69-
* swallowed.
68+
* Send the OTLP job-conclusion span. Errors propagate to the caller; when
69+
* invoked as a main script the top-level `.catch(() => {})` swallows them.
7070
* @returns {Promise<void>}
7171
*/
7272
async function run() {
@@ -85,7 +85,7 @@ async function run() {
8585
await sendOtlpSpan.sendJobConclusionSpan(spanName, { startMs });
8686

8787
if (endpoints) {
88-
console.log(`[otlp] conclusion span export attempted`);
88+
console.log("[otlp] conclusion span export attempted");
8989
}
9090
}
9191

setup/js/assign_agent_helpers.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async function findAgent(owner, repo, agentName, githubClient = github) {
126126
core.error(`Failed to find ${agentName} agent: ${errorMessage}`);
127127

128128
// Re-throw authentication/permission errors so they can be handled by the caller
129-
// This allows ignore-if-missing logic to work properly
129+
// This allows if-missing: ignore logic to work properly
130130
if (
131131
errorMessage.includes("Bad credentials") ||
132132
errorMessage.includes("Not Authenticated") ||

setup/js/claude_harness.cjs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,20 @@ function shouldRetryWithContinue({ attempt, maxRetries, exitCode, hasOutput, isN
233233

234234
/**
235235
* Resolve --prompt-file arguments for the initial Claude run.
236-
* Strips the --prompt-file <path> pair from args and appends the file content
237-
* as the last positional argument, which is where Claude Code expects the prompt.
236+
* Strips the --prompt-file <path> pair from args and appends -- followed by
237+
* the file content as the last positional argument.
238+
*
239+
* The end-of-options marker (--) is essential: Claude Code 2.x treats any
240+
* non-flag argument that follows --mcp-config as an additional config file
241+
* path (variadic flag). Without --, a long prompt appended after
242+
* --mcp-config <path> would be used as a file path, producing an
243+
* ENAMETOOLONG error when the prompt exceeds PATH_MAX (~4096 bytes).
238244
*
239245
* For --continue retries the prompt should be omitted entirely (Claude resumes
240246
* from its on-disk session state). Call this function only for the initial run.
241247
*
242248
* @param {string[]} args
243-
* @returns {string[]} Args with --prompt-file resolved to inline prompt content
249+
* @returns {string[]} Args with --prompt-file resolved to ["--", <content>]
244250
*/
245251
function resolveClaudePromptFileArgs(args) {
246252
/** @type {string[]} */
@@ -275,8 +281,13 @@ function resolveClaudePromptFileArgs(args) {
275281
i++; // Skip the prompt-file path argument
276282
}
277283

278-
// Append the prompt content as the last positional argument (Claude Code convention).
284+
// Append an end-of-options marker followed by the prompt content.
285+
// The '--' prevents Claude Code from treating the prompt text as an additional
286+
// --mcp-config value (Claude Code 2.x accepts that flag variadically, so any
287+
// non-flag positional argument that follows --mcp-config <path> would otherwise
288+
// be tried as a second config file path, causing ENAMETOOLONG for long prompts).
279289
if (promptContent !== null) {
290+
filteredArgs.push("--");
280291
filteredArgs.push(promptContent);
281292
}
282293

@@ -346,11 +357,12 @@ async function main() {
346357
// initialArgs carries prompt text as its last positional arg.
347358
const hadPromptFile = args.includes("--prompt-file");
348359

349-
// Safe arg list for logging: when --prompt-file was present, the last element of
350-
// initialArgs is the resolved prompt content. Replace it with a placeholder so that
351-
// task instructions are never written to stderr or captured in agent logs.
352-
const safeInitialArgs = hadPromptFile && initialArgs.length > 0 ? [...initialArgs.slice(0, -1), "<prompt omitted>"] : initialArgs;
353-
const safeFreshRetryArgs = hadPromptFile && freshRetryArgs.length > 0 ? [...freshRetryArgs.slice(0, -1), "<prompt omitted>"] : freshRetryArgs;
360+
// Safe arg list for logging: when --prompt-file was present, the last two elements of
361+
// initialArgs are the -- end-of-options marker and the resolved prompt content.
362+
// Strip both and replace with a placeholder so task instructions are never written
363+
// to stderr or captured in agent logs.
364+
const safeInitialArgs = hadPromptFile && initialArgs.length > 0 ? [...initialArgs.slice(0, -2), "<prompt omitted>"] : initialArgs;
365+
const safeFreshRetryArgs = hadPromptFile && freshRetryArgs.length > 0 ? [...freshRetryArgs.slice(0, -2), "<prompt omitted>"] : freshRetryArgs;
354366

355367
// Fetch AWF API proxy reflection data before running the agent to capture initial proxy state.
356368
// This is best-effort: failures are logged but do not affect the agent run.

0 commit comments

Comments
 (0)