Skip to content

Report desktop Core errors through an optional file - #154

Merged
yiguodev merged 1 commit into
mainfrom
fix/desktop-startup-errors
Sep 11, 2026
Merged

yiguodev merged 1 commit into
mainfrom
fix/desktop-startup-errors

Conversation

@yiguodev

Copy link
Copy Markdown
Collaborator

Summary

  • Add an optional -error-file argument to the desktop Core CLI so GUI callers can read the actual configuration or startup failure after the process exits, while preserving stderr output and exit codes.
  • Clear stale diagnostics before running and reuse caller-created files so callers retain read access when the Core is elevated.
  • Separate CLI parsing and error reporting from the platform-specific lifecycle, with regression coverage that does not start a Core.
  • Document the option and integration requirements in the English and Chinese READMEs.

Compatibility

Existing commands without -error-file remain unchanged. Callers using the option must bundle a desktop Core that supports it. The Invoke API remains at version 3; no additional preflight validation or runtime accounting is introduced.

Validation

  • Passed: go test ./... -count=1 on macOS.
  • Passed: go test desktop_bin/command.go desktop_bin/command_test.go -count=1 for host-only CLI tests.
  • Passed: git diff --check.
  • Windows/Linux artifact builds, elevated-process integration, and real VPN startup were not tested on this macOS host.

Preserve command failures for GUI callers while retaining stderr output. Isolate CLI reporting for host-only regression tests and document the new option.
Copilot AI lite review requested due to automatic review settings September 11, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yiguodev
yiguodev merged commit 4ef9690 into main Sep 11, 2026
3 checks passed
@yiguodev
yiguodev deleted the fix/desktop-startup-errors branch September 11, 2026 16:24
wejg pushed a commit to wejg/libXray that referenced this pull request Sep 24, 2026
… of https://github.com/XTLS/libXray

* 'main' of https://github.com/wejg/libXray:

* 'main' of https://github.com/XTLS/libXray:
  feat: allow excluding reserved ports from allocation (XTLS#157)
  Restore Matt Pocock skills configuration and documentation (XTLS#156)
  Complete share-link fields and remove legacy VMess QR support (XTLS#155)
  feat: add an optional desktop Core error output file (XTLS#154)
  Validate Xray configurations through instance construction (XTLS#153)
  Update Xray-core to v26.9.9 (XTLS#152)
  refactor: remove runtime accounting and simplify share responses (XTLS#151)
  Add managed runtime accounting and probe APIs (XTLS#150)
  Restore protected desktop DNS resolver (XTLS#148)
  Return validated outbound-only JSON from share conversion (XTLS#147)
  Add Tools .go (XTLS#146)
  Document single Go runtime limitation (XTLS#144)
  Add age-encrypted subscriptions and JSON-based Xray APIs (XTLS#143)
  Fix Windows ARM64 build toolchain (XTLS#142)
  Add concurrent batch ping and improve runtime safety (XTLS#141)
  Validate imported outbounds with Xray-core (XTLS#140)
  Add Android VPN-aware DNS resolver (XTLS#139)
  Update native platform builds (XTLS#138)

# Conflicts:
#	README.md
#	go.mod
#	go.sum
#	invoke.go
#	invoke_model.go
#	invoke_test.go
#	memory/memory_ios.go
#	readme/README.zh_CN.md
#	xray/ping.go
#	xray/xray.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants