feat(#677): add structured needs_input signal for code agent - #1058
feat(#677): add structured needs_input signal for code agent#1058fullsend-ai-coder[bot] wants to merge 3 commits into
Conversation
When the code agent cannot proceed without human intervention (broken tooling, missing scan-secrets, uninterpretable issue), it now emits a structured needs_input signal in agent-result.json instead of silently no-oping. Changes: - Schema: add needs_input (boolean) and needs_input_reason (string) properties to code-result.schema.json - Skill: update SKILL.md steps 8/9a/9c to reference the new "Emitting needs_input" procedure section - Post-script: handle needs_input before the feature branch check — apply fs-code-needs-input label, post explanatory comment, exit 0 - Tests: add detection logic tests, comment body tests, and bundled script grep checks to post-code-test.sh - Bundle: rebuild post-code.sh from post-code.src.sh The fs-code-needs-input label is created on first use (yellow, like requires-manual-review) and reused for all causes — the comment body carries the specifics. Closes #677
|
🤖 Finished Review · ✅ Success · Started 8:43 PM UTC · Completed 9:02 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $9.02 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk: well-scoped additive feature (new schema fields, post-script handling, skill updates, eval case) with bot authorship and clear issue alignment, offset by protected path modifications in scripts/ and skills/. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: well-scoped additive feature (new schema fields, post-script handling, skill updates) with bot authorship and clear issue alignment, offset by protected path modifications in scripts/ and skills/. Previous run (2)Risk Assessment: moderate (2/5) DetailsModerate risk: a well-scoped additive feature (new schema, scripts, and skill updates) with bot authorship and clear issue alignment, offset by high churn and multi-author contention on the heavily-modified post-code scripts. |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsHigh
Medium
Low
Labels: PR modifies code agent post-script and skill behavior Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 9:04 PM UTC · Completed 9:12 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.97 |
- Update SKILL.md schema compliance note to include needs_input and needs_input_reason in the allowed fields list (stale-doc, high) - Add JSON Schema if/then conditional requiring needs_input_reason when needs_input is true, matching the triage schema pattern (api-contract, medium) - Update agents/code.md structured output section to mention needs_input and needs_input_reason fields (stale-doc, medium) - Add third exit state (needs_input) to agents/code.md failure handling section (stale-doc, low) - Add fs-code-needs-input label to docs/code.md control labels table (stale-doc, medium) - Add schema validation test cases for needs_input fields in validate-code-output-test.sh (test-coverage, low) Addresses review feedback on #1058
🔧 Fix agent — iteration 1 (bot-triggered)Addressed 6 of 10 review findings with code changes. Fixed the high-severity stale allowlist in SKILL.md, added if/then schema enforcement for needs_input_reason, updated agents/code.md with new fields and exit state, added fs-code-needs-input to docs/code.md control labels table, and added 5 schema validation test cases. Disagreed with 4 findings: protected-path (informational), section-numbering (intentional), test-adequacy (environment constraint), label-naming (intentional namespacing). Fixed (6):
Disagreed (4):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:14 PM UTC · Completed 9:35 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.87 |
Superseded by updated review
|
/fs-fix add an functional-test eval case for this in |
|
🤖 Finished Fix · ✅ Success · Started 9:12 PM UTC · Completed 9:20 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.64 |
Add eval case 002-needs-input-uninterpretable that exercises the needs_input signal end-to-end: an issue with redacted context and no actionable scope should cause the code agent to emit needs_input: true, triggering the post-script to apply the fs-code-needs-input label and post a blocker comment instead of creating a PR. Update eval judges (pr_created, expected_files) to handle the expect_needs_input annotation, and add a needs_input_signal judge that verifies the label and comment are present. Addresses #1058
🔧 Fix agent — iteration 2 (human-triggered)Added eval/code/cases/002-needs-input-uninterpretable with judges to test the needs_input signal end-to-end: uninterpretable issue → agent emits needs_input → post-script applies label and posts comment → no PR created Fixed (3):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:22 PM UTC · Completed 9:42 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.79 |
| fi | ||
| } | ||
|
|
||
| # --------------------------------------------------------------------------- |
There was a problem hiding this comment.
[low] section-numbering
New block labeled '# 0. Check for needs_input signal' uses 0-based numbering while existing sections in this file use 1-based (# 1 through # 9). The pattern has direct precedent in sibling post-fix.src.sh which uses '# 0. Check for agent commits' for its own pre-pipeline guard.
| forge_create_label "fs-code-needs-input" "Code agent needs human input to proceed" "FBCA04" | ||
| forge_add_label "fs-code-needs-input" | ||
|
|
||
| if ! forge_post_issue_comment "${needs_input_body}"; then |
There was a problem hiding this comment.
[low] label-naming-convention
Label fs-code-needs-input introduces an fs-code- prefix not seen in other flat-named labels. However, the codebase already uses namespaced labels (e.g., risk/* in post-review.src.sh), so prefixed naming is not without precedent. The linked issue #677 explicitly specifies this exact label name as a deliberate design choice.
The 800/700 pair was derived for two cases, but fullsend-ai#1058 adds a third to the same parallelism: 1 leg, and whichever of the two PRs merges second would land a budget that no longer holds: 3 x (120 + 800 + 180 + 30) = 3390s against a 2700s cap. 420/320 gives 3 x 750 = 2250s and keeps a 450s setup allowance — the same margin the two-case derivation reserved, and enough for podman's own ~190s plus the rest. Two cases at this value are 1500s, so merging before fullsend-ai#1058 is safe either way. 500 (the value whose arithmetic reaches 2490s) leaves 210s, which is inside podman alone. The window is a job-budget quotient, not a measured fit: 003 has never run, so if its first real run needs more than 320s the code cases need their own matrix legs rather than a larger share of this one. Said the same thing plainly in 003's budget comment, which called the ceiling "unmeasured" without saying the harness has never executed the case — every Functional Tests run on this branch was gated off as unauthorized. after_each's derivation picks up run_go_checks' 5s kill grace: ~143s worst case, not ~135s. Signed-off-by: guy oron <goron@redhat.com>
Summary
Adds a structured
needs_inputsignal so the code agent can explicitly say "I cannot proceed — a human needs to act" instead of silently no-oping.Problem: When the code agent encounters broken tooling, a missing
scan-secretsbinary, or a genuinely uninterpretable issue, it currently produces no informative signal — the post-script falls through to a generic "No changed files" no-op comment with no explanation.Solution: Three coordinated changes give the agent a structured way to push back:
schemas/code-result.schema.json): New optionalneeds_input(boolean) andneeds_input_reason(string) propertiesskills/code-implementation/SKILL.md): Steps 8 (uninterpretable issue), 9a (missing scan-secrets), and 9c (broken build tooling) now reference a new "Emitting needs_input" procedure sectionscripts/post-code.src.sh): Checks forneeds_inputbefore the feature branch check — appliesfs-code-needs-inputlabel to the issue, posts an explanatory comment with the agent's reason, and exits cleanly (exit 0, no PR)A single label (
fs-code-needs-input) is reused for all causes — the comment body carries the specifics.Testing
make check-bundleCloses #677
Post-script verification
agent/677-code-agent-needs-input)2fbb7da338097ad4c3d659820444c7523a0f1e63..HEAD)