Conversation
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
802a295 to
be5e34c
Compare
|
Evidence:
Recommendation: Re-run the failed CI job. The compaction test suite has latent test pollution that surfaces under CI load. |
be5e34c to
ffc91d5
Compare
|
Failed job: Test / Integration
Root cause analysis:
Recommendation: Re-run CI. These compaction UI tests have known flakiness under CI resource constraints. |
504c4b9 to
1b09a50
Compare
1b09a50 to
fb9d096
Compare
|
This appears to be a flaky integration test, not caused by the auto-cleanup commits:
No code change pushed. Re-running the workflow should clear it; if this recurs, consider extending the test's transient-error retry list to include HTTP 500 alongside 529. Manual intervention needed only if it reproduces on rerun. |
2c81921 to
b451d73
Compare
Replace two inline `error instanceof DOMException && error.name === "AbortError"` checks with the existing shared `isAbortError()` utility from `@/browser/utils/isAbortError`. The shared utility is a superset that handles any Error with name "AbortError" (including DOMException), so behavior is preserved.
… chunk parsing The text-delta and reasoning-delta cases in onAdvisorChunk both cast the chunk to the same shape and probe three field names for a string value, differing only in priority order. Extract a shared helper that takes the chunk and an ordered list of field names, returning the first string found. Behavior is preserved — field lookup order is unchanged.
resolveSkillFilePath and lstatIfExists are only used within skillFileUtils.ts itself. Remove the export keyword to narrow their visibility to file-internal, making the module's public API surface clearer.
The getCancelledCompactionKey function and its entry in the EPHEMERAL_WORKSPACE_KEY_FUNCTIONS array became dead code when useResumeManager.ts (its only consumer) was deleted. Remove both the function definition and the ephemeral-keys array reference.
Remove the private hasErrorCode function from submoduleSync.ts and import the identical exported version from skillFileUtils.ts. Both implementations check whether an unknown error has a specific Node.js error code; the private copy was a verbatim duplicate.
The buildQuickLineReviewNote and buildQuickHunkReviewNote functions in src/browser/utils/review/quickReviewNotes.ts were never imported by any production code since their introduction in PR #2448 (Feb 2026). Remove the module and its test file (482 lines of dead code).
Remove the `export` keyword from `isBashOutputTool` in `src/browser/utils/messages/messageUtils.ts` — the type guard is only used within the same file by `computeBashOutputGroupInfos`, so the export was unnecessary.
…endantAgentTaskIds The method duplicated the DFS tree walk that listCompletedDescendantAgentTaskIds already performs. Delegate to the existing helper instead of reimplementing the traversal inline.
Replace the duplicated Opus 4.7+ regex inside wrapFetchWithAnthropicCacheControl with a call to the existing anthropicSupportsNativeXhigh helper from src/common/types/thinking.ts. The helper already performs the same regex check plus provider-prefix normalization (e.g., anthropic/claude-opus-4-7 via the ai-model-id gateway header), keeping the wire-level detection and the policy-level detection in one place.
The OpenAI/Codex and Copilot fetch wrappers each contained an identical 15-line IIFE that extracted a URL string from the `fetch` `input` argument (handling string, URL, and Request-like shapes). Extract the logic into a single `getFetchInputUrl` helper so both wrappers share one implementation. Behavior-preserving: the helper returns the same empty-string fallback on unrecognized inputs, so callers continue to fall through to normal fetch behavior without throwing.
The deep-clone pattern for PersistedToolModelUsage (spread event, fresh usage object, conditional providerMetadata) was duplicated in recordToolModelUsage and the stream-end tool-usage snapshot. Extract a single file-local helper so both sites share the same implementation. Behavior-preserving: both callsites continue to produce structurally identical clones (usage is always shallow-copied; providerMetadata is included only when non-nullish).
…enuLink The new getTranscriptContextMenuLink helper (from #3188) duplicated the null/contains guard pattern that getClosestTranscriptAncestor — already defined in the same file — performs. Delegate to the shared helper so the target-element and anchor-ancestor checks stay in one place. Behavior-preserving: getClosestTranscriptAncestor returns null for a null/outside-root element, otherwise element.closest(selector), then null again if the ancestor is outside the transcript root — identical to the original inline guards. All 22 transcriptContextMenu tests continue to pass.
When #3192 renamed `gpt-5.4-pro` → `gpt-5.5-pro` across `policy.test.ts`, it accidentally introduced a third `returns medium/high/xhigh for gpt-5.5-pro` test that is byte-identical to the renamed first occurrence (the remaining two unique tests are the bare-prefix and `with version suffix` variants; the deleted block had no version suffix and no gateway prefix). Drop the duplicate so the suite has one canonical no-suffix test, one mux-gateway test, and one version-suffix test. Behavior-preserving — the remaining `getThinkingPolicyForModel` coverage for `gpt-5.5-pro` is unchanged. 63 / 63 tests in \`policy.test.ts\` continue to pass.
b451d73 to
39cfd5f
Compare
Summary
Long-lived auto-cleanup PR that accumulates low-risk,
behavior-preserving refactors picked from recent
maincommits.Changes
Use shared
isAbortErrorutility in AuthTokenModalReplace two inline
error instanceof DOMException && error.name === "AbortError"checks in
AuthTokenModal.tsxwith the existing sharedisAbortError()utilityfrom
@/browser/utils/isAbortError, deduplicating the abort detection logic.Extract
extractChunkDeltaTexthelper to deduplicate advisor chunk parsingPull the repeated
switchoverchunk.type(extractingchunk.textDeltaorchunk.argsTextDelta) into a singleextractChunkDeltaText()helper inadvisorService.ts, then call it from bothexecuteAdvisorStreamandexecuteAdvisorStreamWithRetry.Remove unnecessary exports from
skillFileUtilsUn-export
parseSkillFile,serializeSkillFile, andSKILL_FILENAMEfromsrc/node/services/agentSkills/skillFileUtils.ts— all three are only usedwithin the same file, so the
exportkeyword was unnecessary.Remove dead
getCancelledCompactionKeystorage helperRemove the
getCancelledCompactionKeyfunction and its entry in theEPHEMERAL_WORKSPACE_KEY_FUNCTIONSarray fromstorage.ts— the only consumer(
useResumeManager.ts) was deleted, leaving this as dead code.Remove dead
quickReviewNotesmoduleRemove
src/browser/utils/review/quickReviewNotes.tsand its test file(482 lines). The
buildQuickLineReviewNoteandbuildQuickHunkReviewNotefunctions were never imported by any production code since their introduction
in PR #2448.
Un-export
isBashOutputToolin messageUtilsRemove the
exportkeyword fromisBashOutputToolinsrc/browser/utils/messages/messageUtils.ts— the type guard is onlyused within the same file by
computeBashOutputGroupInfos, so theexport was unnecessary.
Deduplicate
hasErrorCodein submoduleSyncReplace inline
NodeJS.ErrnoException-like error-code checks insubmoduleSync.tswith calls to the existinghasErrorCodehelper,keeping a single canonical place where error-code narrowing lives.
Simplify
hasCompletedDescendantsto reuselistCompletedDescendantAgentTaskIdsRewrite
hasCompletedDescendantsto delegate to the existinglistCompletedDescendantAgentTaskIdshelper instead of re-implementing thetraversal, collapsing the two code paths into one.
Reuse
anthropicSupportsNativeXhighin Anthropic fetch wrapperReplace the duplicated Opus 4.7+ regex inside
wrapFetchWithAnthropicCacheControl(src/node/services/providerModelFactory.ts)with a call to the existing
anthropicSupportsNativeXhighhelper fromsrc/common/types/thinking.ts. The helper already performs the same regexcheck plus provider-prefix normalization (e.g.,
anthropic/claude-opus-4-7via theai-model-idgateway header), keeping thewire-level detection and the policy-level detection in one place.
Extract
getFetchInputUrlhelper to deduplicate URL extractionThe OpenAI/Codex and Copilot fetch wrappers in
providerModelFactory.tseachcontained an identical 15-line IIFE that extracted a URL string from the
fetchinputargument (handling string,URL, andRequest-like shapes).Extract the logic into a single
getFetchInputUrlhelper so both wrappersshare one implementation. Behavior-preserving: the helper returns the same
empty-string fallback on unrecognized inputs, so callers continue to fall
through to normal fetch behavior without throwing.
Extract
clonePersistedToolModelUsagehelper in streamManagerThe deep-clone pattern for
PersistedToolModelUsage(spread event, freshusageobject, conditionalproviderMetadata) was duplicated betweenrecordToolModelUsageand the stream-end tool-usage snapshot instreamManager.ts. Extract a single file-local helper so both sites sharethe same implementation. Behavior-preserving: both callsites continue to
produce structurally identical clones.
Reuse
getClosestTranscriptAncestoringetTranscriptContextMenuLinkThe new
getTranscriptContextMenuLinkhelper (added in #3188) inlinedthe same "resolve event target →
element.closest(selector)→ requireboth to stay within the transcript root" pattern that
getClosestTranscriptAncestor— defined a few lines above in the samefile — already implements. Delegate to the shared helper so the
null/contains guards live in one place. Behavior-preserving: the
helper returns null for a null/outside-root target, then
element.closest("a[href]"), then null again if the anchor is outsidethe transcript root — identical to the previous inline checks. All 22
transcriptContextMenutests continue to pass.Remove duplicate
gpt-5.5-prothinking-policy testWhen #3192 renamed
gpt-5.4-pro→gpt-5.5-proacrosssrc/common/utils/thinking/policy.test.ts, it accidentally introduced athird
returns medium/high/xhigh for gpt-5.5-protest that isbyte-identical to the renamed first occurrence (the two remaining tests
are the bare-prefix and
with version suffixvariants; the deleted blockhad no version suffix and no gateway prefix). Drop the duplicate so the
suite has one canonical no-suffix test, one mux-gateway test, and one
version-suffix test. Behavior-preserving —
getThinkingPolicyForModelcoverage for
gpt-5.5-prois unchanged; 63 / 63 tests inpolicy.test.tscontinue to pass.
Auto-cleanup checkpoint: 797d5a2
Generated with
mux• Model:anthropic:claude-opus-4-7• Thinking:xhigh