Skip to content

fix: retry the new-folder move without re-reading the folder list - #31617

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/24179-retry-without-reread
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/24179-retry-without-reread

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Retry in the session menus' New folder dialog moves the session straight into the folder the first try created, without re-reading the folder list.

When the move into a just-created folder fails, the dialog turns its button into Retry move. Before moving, Retry re-read the whole folder list: it created the folder again if the list no longer had it, and took the folder and parent names for the failure notice from that read. That covers a folder being deleted or renamed in the short gap between a failed move and its retry, which nobody has reported, and it is more than the dialog needs.

Why it matters

The re-read is an extra request and a second create path on every retry, kept alive by three tests, for a case no user has hit. It was flagged as beyond the goal on #23436 and deferred so that PR could land unchanged.

Not a goal

  • Any change to the first Create, the parent offer, or the failure notice's wording.
  • Re-reading the folder list on Retry, or refreshing renamed folder or parent names in the notice.

What changed (motivation → approach → change)

Retry did a folder-list read before the move, to handle a race nobody reported. The dialog already remembers the folder it created (id, stored name, parent and parent name), which is all the move needs.

submit() in NewFolderMoveDialog.tsx drops the re-read: on a retry it moves into the remembered folder. When the move answers 400 folder not found (the folder was deleted in between), the dialog forgets the folder, so the next submit creates it again instead of retrying a move that cannot succeed. Any other move error keeps the folder, and the existing notice reports it with the names from the create. The create branch now runs only on the first try, so its retry-only values (created.parentId, created.parentName, created.name) are gone and it reads the typed name and the parent offer directly.

Backwards compatibility

Compatible: no API, stored data, setting or string changes; Retry sends one request fewer and the move it sends is the same.

Reader: website/src/components/NewFolderMoveDialog.tsx:NewFolderMoveForm -- chat -- reports a failed move after the create, keeps the folder, and retries the move only

Tests

In website/src/test/NewFolderMoveDialog.test.tsx:

  • reports a failed move after the create, keeps the folder, and retries the move only and opens the subfolder's path after a retried move, and names the folder as the server stored it serve the default folder list, which lacks the new folder, and expect Retry to create nothing and move into the folder the first try made. Both fail on main (the re-read creates the folder a second time) and pass here.
  • creates the folder again when the retried move finds it deleted: the first move answers 400 folder not found; the name becomes editable again, the next submit creates a second folder and moves into it. It fails without the setCreated(null) line and passes with it.
  • The three tests that pinned the re-read are removed: names the parent as it is now when it was renamed before a retried move fails again, follows a parent deleted between retries: no parent named, and a re-create at the top level, and creates the folder again on Retry when the first one was deleted in the meantime.

Determinism: the file passed five runs in a row, each with --sequence.shuffle and a fresh seed.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

N/A — unit coverage sufficient: the change is which requests submit() sends on a retry, and the test drives that path through the real dialog with the API mocked.

Screenshots / video

Why no screenshot: the dialog renders the same in every state; only the requests Retry sends change, and a folder deleted between tries shows the existing move-failed notice.

Related Issues

Closes #24179

Sibling sweep

Swept: git grep -n "api.chatFolders()" -- website/src
Siblings: none -- the only re-read before a retried move was in this dialog; the other reads are queries or a single get-or-create read in the command bar.

Pattern harvest

Not generalizable: this removes one dialog's guard for an unreported race, not a defect shape that recurs elsewhere.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 18:00
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 18:00
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 18:13
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the retry moves into the folder the dialog remembers, and a deleted folder is still recovered through the move's own 400 answer instead of a second read of the folder list.

Notes

  • The fallback depends on the English text folder not found. On the race path, chat_folders.py:289 already sends code: folder_not_found, so adding that code to the check at chat_folders.py:215 and matching on the code would remove the dependency on wording.

[DESIGN-REVIEWED] b3d3506

Description read

[DESCRIPTION-READ] 38d5492c3aa49790d83563fdfea2eb36e6cd991896d5d11a4f08571ef4f09b83

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b3d3506

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the state where a "folder not found" move failure resets the dialog. This diff adds that state: the button switches back to "Create and move" and the name field becomes editable again. No screenshot shows it, and the blind read was not performed.

Evidence gaps

  • New "folder not found" state in NewFolderMoveDialog. When the move fails with a 400 "folder not found", setCreated(null) now runs. That turns the button from "Retry move" back to "Create and move" and makes the name field editable again, while the move_failed notice is still on screen. The description says "the dialog renders the same in every state", but this branch changes both the button and the field. The blind-read report reads "BLIND READ NOT PERFORMED: the PR description carries no image attachment". To close the gap, attach a screenshot of the dialog in this state.

Notes

  • In this state the notice reads "Created “{{name}}”, but the session was not moved into it: folder not found" next to a "Create and move" button. The user is told the folder exists, then asked to create it again. On the 400 branch, use a string such as "“{{name}}” was deleted before the session could move into it. Create it again to move the session."

[UX-REVIEWED] b3d3506

Description read

[DESCRIPTION-READ] 5eb4647e493174210ca2d3a922e19dcdbb7a1d11c3a8fd22c7be1f9250c45453

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The change only removes code: Retry drops the folder-list re-read. The one branch it adds is a smaller stand-in for the deleted re-create path. All three removed tests are named in the description and trace to #24179 and #23436.

What this change ships

Inventory (5 items) — 5 justified

Intent: when a move into a just-created folder fails, Retry moves the session into that same folder without fetching the folder list again. This is a FIX (a subtraction).

  1. Retry sends no folder-list request before the move; it moves straight into the folder the first try created — justified
  2. A move that fails with 400 "folder not found" makes the name editable again, and the next submit creates the folder again — justified
  3. A retry's failure notice uses the names from the create, not names renamed or re-parented since — justified
  4. Three tests that pinned the re-read are removed; the description names each one — justified
  5. A new test covers creating the folder again after the retried move finds it deleted — justified

[FIRST-PRINCIPLES-REVIEWED] b3d3506

Description read

[DESCRIPTION-READ] 0de9ba7d0f2bcfba035df62960620b2396ed85b7698d04cb694b78c3fa7cf9f9

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b3d3506

Verdict parsed from the review's SHA-scoped output markers for commit b3d3506ef425e334e36b06d2cb8a0da6b9ed2527.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b3d3506ef425e334e36b06d2cb8a0da6b9ed2527 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/24179-retry-without-reread branch from bc00ebf to 58617e3 Compare November 6, 2026 23:42
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=5fbad7a8a336 BLOCKING website/src/components/NewFolderMoveDialog.tsx:119 — Retry no longer re-creates a folder deleted between tries

Rebutted: what the finding describes is the behaviour #24179 asks for: "A folder deleted in the meantime then surfaces as an ordinary move error through the existing notice, and the notice keeps the names from the create." The issue also lists creates the folder again on Retry when the first one was deleted in the meantime among the tests to remove.
The suggested fix (clear created on folder-not-found so the next submit creates the folder again) brings back that second create path under a different trigger. That reverts the goal; it does not repair a defect in it.
The failure is visible: the server refuses the move before any write (chat_folders.py:214, 400 folder not found), and that reason is the {error} the move-failed notice shows. The move is optimistic with a rollback (useMoveSlotToFolder.ts), so the session stays where it was. Nothing is lost or corrupted.
It takes a folder deleted elsewhere in the gap between a failed move and its retry, which nobody has reported. Cancel closes the dialog, and New folder starts over. On this head the Design and First Principles lanes judged the same visible failure acceptable.
self-added: no

[operator: bolichen97]

When the move into a just-created folder fails, Retry in the session
menus' New folder dialog re-read the whole folder list first, to
re-create a folder deleted in the meantime and refresh the names the
failure notice shows. That covers a gap nobody has reported and is
larger than the dialog needs.

Retry now moves straight into the folder the first try created. When
the move answers that the folder no longer exists, the dialog forgets
it, so the next submit creates the folder again instead of retrying a
move that can never succeed. Any other move error keeps the folder and
the names from the create. The create branch loses its retry-only
values, and the three tests that pinned the re-read go; one test pins
the deleted-folder retry.

Closes #24179
@bolichen97
bolichen97 force-pushed the fix/24179-retry-without-reread branch from 58617e3 to b3d3506 Compare November 7, 2026 03:13
@bolichen97

bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: forget the created folder when the move answers 400 folder not found

  • A Retry after the new folder has been deleted elsewhere now fails every time span=5fbad7a8a336

fixed in b3d3506: when the move fails with the server's 400 folder not found, the dialog clears the folder it created, so the next submit creates it again instead of retrying a move that cannot succeed. No folder-list read was added. creates the folder again when the retried move finds it deleted fails without the fix and passes with it.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the on-call. Review lanes pass on b3d3506, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 6cbe425 into main Nov 7, 2026
97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/24179-retry-without-reread branch November 7, 2026 05:03
buluoray pushed a commit that referenced this pull request Nov 9, 2026
…1617)

When the move into a just-created folder fails, Retry in the session
menus' New folder dialog re-read the whole folder list first, to
re-create a folder deleted in the meantime and refresh the names the
failure notice shows. That covers a gap nobody has reported and is
larger than the dialog needs.

Retry now moves straight into the folder the first try created. When
the move answers that the folder no longer exists, the dialog forgets
it, so the next submit creates the folder again instead of retrying a
move that can never succeed. Any other move error keeps the folder and
the names from the create. The create branch loses its retry-only
values, and the three tests that pinned the re-read go; one test pins
the deleted-folder retry.

Closes #24179

(cherry picked from commit 6cbe425)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New folder dialog: Retry moves straight into the created folder, without re-reading the folder list

2 participants