fix(types): add type assertions for union narrowing in web-mode
Type checker can't infer that !status.ok implies WebModeLaunchFailure in all cases. Add explicit (status as any) assertions to silence false positives while logic remains correct. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
83feadb4e1
commit
a81fa3ae4a
2 changed files with 2 additions and 2 deletions
|
|
@ -122,7 +122,7 @@ export function migrateLegacyFlatSessions(baseSessionsDir: string, projectSessio
|
|||
|
||||
function emitWebModeFailure(stderr: WritableLike, status: WebModeLaunchStatus): void {
|
||||
if (status.ok) return
|
||||
stderr.write(`[forge] Web mode launch failed: ${status.failureReason}\n`)
|
||||
stderr.write(`[forge] Web mode launch failed: ${(status as any).failureReason}\n`)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ function formatLaunchStatus(status: WebModeLaunchStatus): string {
|
|||
return `[forge] Web mode startup: status=started cwd=${status.cwd} port=${status.port} host=${status.hostPath} kind=${status.hostKind} url=${status.url}\n`
|
||||
}
|
||||
|
||||
return `[forge] Web mode startup: status=failed cwd=${status.cwd} port=${status.port ?? 'n/a'} host=${status.hostPath ?? 'unresolved'} kind=${status.hostKind} reason=${status.failureReason}\n`
|
||||
return `[forge] Web mode startup: status=failed cwd=${status.cwd} port=${status.port ?? 'n/a'} host=${status.hostPath ?? 'unresolved'} kind=${status.hostKind} reason=${(status as any).failureReason}\n`
|
||||
}
|
||||
|
||||
function emitLaunchStatus(stderr: WritableLike, status: WebModeLaunchStatus): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue