Repository navigation
fix(acp): optional question fields no longer block submission - #21801
GeorgieSmile wants to merge 3 commits into
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This changes the production default semantics for ACP forms by treating fields absent from You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Propagate ACP required fields packages/contracts/src/providerRuntime.ts, packages/provider-acp/src/server/adapter.ts, apps/server/scripts/acp-mock-agent.ts, apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts |
The question contract accepts an optional required flag. The ACP adapter marks schema fields outside the required list as optional. The mock agent and adapter tests cover optional-field elicitation. |
Skip unanswered optional questions packages/client-runtime/src/state/pendingUserInput.ts, packages/client-runtime/src/state/pendingUserInput.test.ts, apps/web/src/pendingUserInput.ts, apps/web/src/pendingUserInput.test.ts, apps/web/src/components/chat/usePendingThreadRequests.ts |
The answer builder skips unanswered optional questions unless attachments are blocked. Web progress allows skipping such questions, and response projection omits answers that are undefined. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant AcpFormSchema
participant AcpAdapter
participant buildPendingUserInputAnswers
participant onRespondToUserInput
AcpFormSchema->>AcpAdapter: required field IDs
AcpAdapter->>buildPendingUserInputAnswers: questions with required flags
buildPendingUserInputAnswers->>onRespondToUserInput: answers excluding unanswered skippable questions
onRespondToUserInput->>onRespondToUserInput: project defined answers
Possibly related issues
pingdotgg/t3code#23505— This change supports omitting unanswered optional fields, but does not address the issue’s choice-mapping or layout defects.
Suggested labels: bugfix
Suggested reviewers: t3dotgg, juliusmarminge, stienswout
Merge Risk: 
Minimal · up to 217ea
-
Optional ACP answers can be omitted while required answers remain enforced. No merge-blocking issue was identified.
Security architecture risk: 
Low · up to 4b593
-
The change is additive and preserves the inspected request-identity, permission-decision, and attachment-readiness checks. No introduced security issue was established. Remaining uncertainty concerns downstream agent validation and mixed-version behavior.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The changed influence is provider-controlled question completeness within the existing request flow. No additional environment, data-store, credential, or tool authority was identified in the inspected change. Responses remain associated with an existing thread, request, and live provider session.
Security Findings and Attack Paths
- observed — The live ACP accept path does not locally validate answer completeness against required fields. That behavior exists at both the exact base and head: supplied answers are filtered and returned as accepted content. Downstream agent validation remains unverified; this is an existing validation limitation, not an established PR-introduced vulnerability.
Trust Boundaries and Controls
- observed — Web and mobile submitters retain environment-operation-scope checks. Server dispatch rejects missing, non-pending, or non-resumable requests; forwarding checks the live provider-session identity and active session. Optionality does not replace these inspected controls.
Resilience and Maintainability Implications
- observed — ACP admission and response handling retain generation checks, single-settlement rejection, and ensuring cleanup of pending user-input records. Cancellation settles user input with null, preserving its distinction from an accepted empty answer map.
-
Pre-merge checks: 
4
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 9
- Charged: $2.25
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
|
Note Written by merged current main without rebasing. preserved native droid forms, moved optional-answer handling into the shared web/mobile helper, and updated the existing fallback-form expectation. the diff is nine files, smaller than the original ten-file change. blacksmith at |
Problem
When an ACP agent sends an optional question field, T3 Code still requires an answer before allowing submission.
With OMP, this happens when a choice question includes an optional “Other (type your own)” field. Leaving Other blank disables Submit; entering text there can override the selected choice. OMP omits the form’s
requiredlist, which makes its fields optional.Change
Preserve the form’s required-field information through the ACP adapter and shared question schema. Web and mobile now omit empty optional answers while continuing to require mandatory answers and wait for blocked attachments.
The web submit handler also avoids reintroducing omitted answers as undefined values, which the RPC schema rejects. Other providers keep their existing behavior when the flag is absent.
Related: #21770 fixes titled choice display separately. This PR does not include that change.
Scope and approval
This is a focused fix for an existing bug: the provider allows fields to be omitted, but the clients require them. The adapter, contract, and client changes are necessary to preserve the same constraint throughout the question flow.
Submitted under the focused-bug-fix exception in CONTRIBUTING.md.
Verification
User selected: Beta; the persisted response contained only{"q0":"Beta"}. The provider instance was confirmed asacpRegistry_omp. The temporary combination was removed afterward.Combined-flow recording (3× playback): select Beta, leave Other blank, submit, and receive the agent’s reply. Evidence is hosted separately in the fork and is not part of this PR’s commits.
Not checked manually: native mobile UI, Electron UI, or remote/relay connections. Mobile answer-building behavior has unit coverage.
Written with Claude Opus 5.5 in Claude Code and GPT-6.1-Sol in the Codex harness, run from T3 Code.
takeover verification
merged current main without rebasing, preserving native droid forms and moving optional-answer handling into the shared web/mobile helper. updated the existing fallback-form assertion for the optional flag.
blacksmith
vp run check:changed github/mainpassed: 107 tests, 35 affected package typechecks, formatting, lint, knip, graphql and react compiler checks. two independent source reviews approved217ead53fcwithout findings.verified through the real web client and local acp mock subprocess: required color blocks advancement; selecting blue and leaving note empty submits successfully. the persisted resolved request contains only
{"color":"blue"}. native mobile, electron, remote/relay and a live omp process remain unverified in this pass.verification by gpt-6.1-sol in the codex harness.