Files
kilocode/packages/opencode/test
rakshith1928 c8e9c3bf8f fix(cli): surface real --cloud-fork import failure reasons (#12388)
* test(cli): add failing importCloudSession regression tests

Add unit tests pinning the behavior of importCloudSession's HTTP/parse handling. Two cases are red against the current implementation (a server HTTP error and a missing local id are silently swallowed as undefined instead of surfaced), one confirms the success path, and one guards that raw fetch exceptions keep propagating. The two failing cases will go green once importCloudSession is taught to throw on error.

* fix(cli): throw on cloud session import failures

importCloudSession previously returned undefined on any failure, silently swallowing the server's HTTP error (401/403/404/500) or a missing local id. Teach it to throw instead: with the server's error message on an HTTP error, or a clear message when the response is malformed. The four cloud-fork call sites keep branching on a missing id, but now reach that branch via catch rather than via a swallowed undefined, so the failure reason can be surfaced by callers.

* fix(kilocode): surface cloud-fork import failure reason in TUI thread entry

The Kilo-mirror thread entry swallowed import errors via a .catch(() => undefined) that returned empty, hiding the real 401/403/404/500 cause. Replace it with a try/catch that logs the underlying error at debug level and prints it to stderr, so a failed --cloud-fork import now reports why it failed instead of failing silently.

* fix(cli): surface cloud-fork import failure reason at shared call sites

The three shared upstream cloud-fork entry points (attach, run, tui thread) each swallowed import failures via a .catch(() => undefined) that lost the underlying 401/403/404/500 or network error. Wrap each call in a try/catch that logs the cause at debug level and prints it to stderr, preserving each site's existing exit semantics (process.exit / shutdownAndExit / early return). This keeps the diff to shared opencode files scoped inside the existing kilocode_change blocks.

* docs: add changeset and kilocode_change annotations for cloud-fork import errors

Adds the patch changeset describing the user-visible fix (failed --cloud-fork imports now report the underlying reason in both the user-visible message and the DEBUG log stream), and adds the required kilocode_change markers around the new Log/errorMessage imports and module-level loggers in the shared upstream files (run.ts, attach.ts) so the annotation CI check passes.

* refactor(cli): dedupe cloud-fork import error reporting

Extract a shared reportCloudImportError helper in kilocode/cloud-session.ts so the four cloud-fork import sites surface the real failure (HTTP status/body or fetch error) consistently via UI.error plus a DEBUG log, instead of duplicating that logic at each call site.

* fix(cli): extract { error } reason from cloud-session import failures

* fix(cli): reorder reportCloudImportError last in cloud-session import

* chore: add run.ts import fix
2026-08-13 15:51:21 +02:00
..
2026-07-30 14:24:24 +02:00
2026-07-29 02:06:01 +02:00
2026-07-22 13:31:23 +02:00
2026-08-05 16:01:49 +02:00
2026-07-29 02:06:01 +02:00
…
2026-07-29 02:06:01 +02:00
2026-07-29 02:06:01 +02:00
…
2026-07-30 14:24:24 +02:00
2026-07-30 14:24:24 +02:00
2026-08-06 00:31:20 +02:00
2026-07-29 02:06:01 +02:00
2026-08-06 14:10:41 +02:00
2026-07-30 14:24:24 +02:00
2026-07-30 14:24:24 +02:00
2026-08-06 14:10:41 +02:00
2026-07-30 14:24:24 +02:00
2026-07-30 14:24:24 +02:00
2026-08-06 14:10:41 +02:00
…
…
2026-07-22 13:31:23 +02:00