fix(editor): reword the host-unresolved copy and namespace its sentinel

The copy no longer points at a Close control that is gone ("close this
tab from the tab strip") and no longer claims a scan is in progress, since
`selector_not_found` is also thrown synchronously for unregistered folder
workspaces and removed repos. The sentinel becomes
`editor_host_workspace_unresolved` so it cannot be confused with the CLI's
`worktree_host_unresolved` client error. The doc comment narrows the
"no definitive absence code" claim to git worktrees and names the two host
codes that are definitive but not yet classified.

Refs #21041
This commit is contained in:
Neil
2026-09-17 23:14:01 -07:00
parent 9229b8b2dc
commit 893ba20819
3 changed files with 17 additions and 12 deletions
@@ -10,7 +10,7 @@ function localizeFileLoadError(message: string, code: string | undefined): strin
if (code === WORKTREE_HOST_UNRESOLVED_CODE) {
return translate(
'editor.fileLoad.hostUnresolved',
"The host couldn't find this file's workspace. It may have been removed, or the host may still be scanning. Retry, or close the tab."
"The host couldn't find this file's workspace. It may have been removed, or the host may not know about it yet. Retry, or close this tab from the tab strip."
)
}
return message
@@ -21,25 +21,30 @@ export const WORKTREE_OWNER_UNREACHABLE_ERROR =
/**
* Machine code the runtime host returns when its worktree resolver cannot place
* the file's workspace. It is UNKNOWN, not absence: the same code covers a deleted
* worktree and a cold or failing scan (see remote-browser-stream-errors.ts), and
* the file-read path has no definitive "gone" answer. The retry gate bounds it,
* then swaps in the terminal message below — never an automatic close (#21041).
* git worktree, a cold or failing scan (see remote-browser-stream-errors.ts), and
* a synchronous miss for an unregistered folder-workspace id or removed repo. For
* git worktrees the file-read path has no definitive "gone" answer; the codes that
* are definitive (`folder_workspace_path_missing:<path>`,
* `worktree_execution_host_unresolved`) are not classified here yet and still land
* on their raw text. The retry gate bounds this one, then swaps in the terminal
* message below — never an automatic close (#21041).
*/
export const WORKTREE_HOST_SELECTOR_NOT_FOUND_CODE = 'selector_not_found'
/**
* Client-side sentinel stored on `loadErrorCode` once the selector-not-found retry
* budget is spent. The comparison key is deliberately not the display text, so
* localizing the message can never break the terminal-state check. Truthful about
* what is known (the host could not resolve the workspace) and what is not (whether
* it still exists); Retry starts a fresh budget, Close is the user's call so an
* unsaved draft is never discarded on the host's behalf (#21041).
* budget is spent. Namespaced `editor_` so it cannot be confused with the CLI's
* `worktree_host_unresolved` client error. The comparison key is deliberately not
* the display text, so localizing the message can never break the terminal-state
* check. Truthful about what is known (the host could not resolve the workspace)
* and what is not (whether it still exists); Retry starts a fresh budget, and the
* only close path is the tab strip's own, so nothing here discards a draft (#21041).
*/
export const WORKTREE_HOST_UNRESOLVED_CODE = 'worktree_host_unresolved'
export const WORKTREE_HOST_UNRESOLVED_CODE = 'editor_host_workspace_unresolved'
/** English fallback for `loadError` alongside the code above; the error view localizes it by code. */
export const WORKTREE_HOST_UNRESOLVED_ERROR =
"The host couldn't find this file's workspace. It may have been removed, or the host may still be scanning. Retry, or close the tab."
"The host couldn't find this file's workspace. It may have been removed, or the host may not know about it yet. Retry, or close this tab from the tab strip."
export type FileContent = {
content: string
+1 -1
View File
@@ -120,7 +120,7 @@
"openAnyway": "Open anyway"
},
"fileLoad": {
"hostUnresolved": "The host couldn't find this file's workspace. It may have been removed, or the host may still be scanning. Retry, or close the tab."
"hostUnresolved": "The host couldn't find this file's workspace. It may have been removed, or the host may not know about it yet. Retry, or close this tab from the tab strip."
}
},
"githubChecks": {