Uh oh!
There was an error while loading. Please reload this page.
[codex] Structure thread archive blocked error - #3451
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityA prior Macroscope approval was dismissed. Re-evaluating 97f917b… No code changes detected at |
e5d12e1 to
97f917bCompareDismissing prior approval to re-evaluate 97f917b
7f6ba15 to
c902fcdCompareCo-authored-by: codex <codex@users.noreply.github.com>
c902fcd to
7780446CompareUh oh!
There was an error while loading. Please reload this page.
ThreadArchiveBlockedErroraccepted a caller-suppliedmessageeven though the archive guard has only one semantic failure. That made the error's meaning mutable at each construction site and kept it outside the schema-based error conventions used elsewhere.This changes the error to an empty-shape
Schema.TaggedErrorClasswith the existing caller-visible text derived by a constantmessagegetter. The archive guard now constructs the error without redundant message data.A focused test locks down the exact message without adding a broad hook refactor test.
Validation:
vp test run apps/web/src/hooks/useThreadActions.test.tsvp check(passes with 20 existing warnings)vp run typecheckNote
Low Risk
Localized error-type refactor in thread archive handling with no change to archive success paths or broader hook behavior.
Overview
ThreadArchiveBlockedErroris now aSchema.TaggedErrorClasswithenvironmentIdandthreadIdinstead of a caller-suppliedmessage. The user-facing text is fixed via amessagegetter ("Cannot archive a running thread."), matching other schema-based errors.The running-thread archive guard constructs the error with
threadRefids only. A small unit test asserts the structured fields and exact message.Reviewed by Cursor Bugbot for commit 7780446. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
environmentIdandthreadIdfields toThreadArchiveBlockedErrorConverts
ThreadArchiveBlockedErrorfrom aData.TaggedErrorto aSchema.TaggedErrorClassso it carries structuredenvironmentIdandthreadIdfields. The error message is now a fixed string via a getter rather than a passed-in argument. When archiving a running thread fails, these fields are populated from the current thread reference.Macroscope summarized 7780446.