fix(components): a missing cloud token must not disable the local file handoff - #17
Draft
pythonlearner1025 wants to merge 1 commit into
Draft
Conversation
…e handoff All three attachment entry points bail on `if (!workspaceId || !authToken)` before they reach the local handoff, and that handoff needs no cloud token: it hands the bytes to the machine that runs the session over the local IPC transport. A composition with no cloud token — the local desktop entry, which must not make authenticated product-cloud requests — therefore fails every `+` attachment with "Missing workspace or auth token" without issuing a single request, and Retry re-enters the same guard. Move the local handoff in front of the guard in `startFileUpload` and in the chat-landing file draft, adding `workspaceId &&` to its own condition; the guard keeps its text and still owns the cloud path below it. For images, widen the guard to `!workspaceId || (!authToken && !canSendFileLocally)` and throw inside the `try` when there is no token, so a tokenless image lands in the `catch` that already degrades a failed image upload to a pending file attachment over the local transport. With a token present the order of operations is unchanged: the guard passes, the local path runs first and the cloud path second, exactly as before. Model: claude-opus-5[1m]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All three attachment entry points bail on
if (!workspaceId || !authToken)before they reach the local handoff, and that handoff needs no cloud token: it
hands the bytes to the machine that runs the session over the local IPC
transport. A composition with no cloud token — the local desktop entry, which
must not make authenticated product-cloud requests — therefore fails every
+attachment with "Missing workspace or auth token" without issuing a single
request, and Retry re-enters the same guard.
Move the local handoff in front of the guard in
startFileUploadand in thechat-landing file draft, adding
workspaceId &&to its own condition; the guardkeeps its text and still owns the cloud path below it.
For images, widen the guard to
!workspaceId || (!authToken && !canSendFileLocally)and throw inside the
trywhen there is no token, so a tokenless image lands inthe
catchthat already degrades a failed image upload to a pending fileattachment over the local transport.
With a token present the order of operations is unchanged: the guard passes, the
local path runs first and the cloud path second, exactly as before.
Compatibility
Every change is additive at its default. With the new prop, parameter or flag
absent, the touched components render and behave exactly as they do today, and
no existing call site in this repository passes one.
Testing
packages/componentstypecheck and the full vitest suite pass. No new test is added here: the three entry points need a workspace runtime and a live IPC bridge to exercise, and this repo has no harness for either. The behaviour is verifiable by hand in a local composition — attach a file with no cloud token and watch the handoff run.Notes for the reviewer
Two of the three moved blocks had the credential guard as their only reachable predecessor, so with a token present the order of operations is byte-identical.
Review metadata
BlitzOS fork only. Delete this section before sending the PR to
LodyAI/Lody.blitz/seam-8-local-file-handoff-before-token-guardf3474894 (the pinned upstream commit)