Skip to content

feat: add agent user_request input#1434

Draft
tarunag10 wants to merge 1 commit into
anthropics:mainfrom
tarunag10:codex/agent-user-request-input
Draft

feat: add agent user_request input#1434
tarunag10 wants to merge 1 commit into
anthropics:mainfrom
tarunag10:codex/agent-user-request-input

Conversation

@tarunag10

Copy link
Copy Markdown
Contributor

Summary

Adds a first-class user_request input for agent mode and writes it to claude-user-request.txt after prompt-dir cleanup.

Fixes #1427.

Root cause

Agent mode currently clears ${RUNNER_TEMP}/claude-prompts before writing claude-prompt.txt. That correctly removes stale prompt files, but it also deletes claude-user-request.txt files that composite actions intentionally pre-write before invoking this action.

The base SDK runner already supports claude-user-request.txt: when it exists alongside the prompt file, it sends a multi-block user message so Claude Code can process slash commands from the user request. After the cleanup change, downstream composite actions no longer had a supported point to provide that file.

Changes

  • Adds user_request to the top-level action inputs.
  • Exports it as USER_REQUEST and parses it into context.inputs.userRequest.
  • In agent mode, writes claude-user-request.txt after stale prompt files are cleared.
  • Keeps existing prompt cleanup behavior, so stale files from prior invocations are still removed.
  • Adds a regression test that starts with a stale user request file, runs agent mode, and verifies the new request replaces it.

Validation

  • ./node_modules/.bin/prettier --check .
  • bun test test/modes/agent.test.ts test/github-context.test.ts base-action/test/run-claude-sdk.test.ts
  • bun run typecheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent mode wipe of claude-prompts/ (PR #1288) breaks composite actions that pre-write claude-user-request.txt

1 participant