Repository navigation
refactor(auth): reuse privately assembled choice groups - #152166
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 5:07 PM ET / 21:07 UTC. ClawSweeper reviewWhat this changesThe PR removes redundant copies while assembling authentication menus, preserving option identities, metadata, and ordering. Merge readiness✅ Ready for maintainer review Keep open: this is a sound, bounded cleanup that current main does not contain. No actionable correctness or security findings were identified. Priority: P3 Review scores
Verification
How this fits togetherThe authentication menu builder turns provider setup choices into sorted groups for onboarding and agent setup. The interactive prompt consumes those groups to offer providers and authentication methods. flowchart TD
A[Provider setup choices] --> C[Filter and group choices]
B[Core choices] --> C
C --> D[Sort private groups and options]
D --> E[Interactive setup menu]
E --> F[Selected authentication method]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1. Total +1 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep menu assembly within its existing owner and reuse invocation-private groups while preserving all sorting and caller-owned option identities. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving cleanup rather than a bug report; current-main source confirms the redundant copies. Is this the best way to solve the issue? Yes: assigning sorted options to freshly created private groups removes the copies without adding another implementation path or changing public contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 400d1f8d0fef. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…n-20260918-v4 * origin/main: (81 commits) fix: retire failed setup plugins without replaying facade initialization (#152026) fix(test): select Node for built runtime recovery fixtures (#152162) refactor(auth): reuse privately assembled choice groups (#152166) fix: preserve chat media delivery and session boundaries (#152079) fix: keep stale Stop messages from canceling replacement sessions (#152116) improve(plugins): reduce mutable argument handling overhead (#152154) fix(scripts): prevent host tooling drift from blocking PR workflows (#152078) improve: reduce model capability preparation work (#152128) fix: stop marking delivered scheduled reports as failed (#152165) fix: start background context maintenance after durable turns (#151936) fix(models): avoid ambient state reads during prepared selection (#152119) feat: recover abandoned Crabbox source staging (#152006) chore(ui): refresh control ui locales (#152098) fix(ui): keep cloud startup prompts and progress in chat (#152024) fix: report completed subprocess cleanup after cancellation (#152107) perf(reply): reuse normalized inbound text (#152110) fix(cron): paused future one-shots disappear after Run now (#152126) perf(sessions): reuse rows and skip discarded terminal labels (#152109) fix(ui): keep keyboard-focused automation controls clear of sticky actions (#152135) fix(ui): load remote images in compact activity previews (#152045) ...
What Problem This Solves
Auth-choice menu assembly copies each freshly created private group and copies its options array immediately before a sorting operation that already returns a new array.
User Impact
No user-visible behavior change. Menu order, selection, cancellation, metadata, and caller-owned option identities remain unchanged. This is a bounded cleanup of intermediate copies; measurements do not establish a general onboarding speedup.
Why This Change Was Made
Assign the sorted options to the invocation-private group and return that group. Retain the original assembly pipeline and all three sorting layers. No group escapes before assembly completes, and no input or caller-supplied group is mutated. Production grows by one formatted line because the private assignment is explicit; no new wrapper, cache, or public contract is introduced.
Evidence
The baseline and candidate passed all 24 existing auth-choice/options/prompt/discovery tests. Additional artifact-only proof exercised the real grouped prompt through the actual builder, covering full menus, selection/error traces, container freshness, option identities, descriptors/key order, duplicate/tie ordering, visibility, More/Back/skip/keep-current, cancellation, and upstream errors. All maintained changed-file checks passed. Independent managed Codex P2 review found no actionable findings; a separate evidence audit verified source/fixture bindings and all observations.
A fixed AB/BA/AB comparison retained 1,824 observations, including 1,368 measured calls across 19 cases. Small-group builder wall medians improved 16.97%/6.48%/3.72%. The synthetic 92-choice builder improved 20.51%/6.16% but regressed 10.96% in the third pair; its pooled wall change was −8.65%. The 1,000-choice scaling case regressed 28.49% before improving 2.48%/4.13%, with pooled wall +2.35% and CPU +1.41%. Overall, 18/57 wall and 16/57 CPU comparisons were adverse; 16 CPU comparisons were exactly neutral. Unchanged controls also moved. Every adverse and near-zero comparison remains in the retained results.
These are microsecond/submillisecond owner measurements on a shared host, not full CLI, live metadata, allocation, or memory measurements. No full build or live authentication/network run was selected because imports, schemas, plugin loading, credential writes, and auth execution are unchanged. A broader earlier private assembly variant and its predominantly adverse results are preserved separately; no timing was transferred between variants.