Commit Graph

265 Commits (6f6b25a04c1951fa8a5dac63bb7bae8136a207fc)

Author SHA1 Message Date
Aftab 700efe6d16
fix(daemon): skip machine-scope fallback on permission-denied bus errors (#62337)
* fix(daemon): skip machine-scope fallback on permission-denied bus errors; fall back to --user when sudo machine scope fails

When systemctl --user fails with "Failed to connect to bus: Permission
denied", the machine-scope fallback is now skipped. A Permission denied
error means the bus socket exists but the process cannot connect to it,
so --machine user@ would hit the same wall.

Additionally, the sudo path in execSystemctlUser now tries machine scope
first but falls through to a direct --user attempt if it fails, instead
of returning the error immediately.

Fixes #61959

* fix(daemon): guard against double machine-scope call when sudo path already tried it

When SUDO_USER is set and machine scope fails with a non-permission-denied
bus error, execution falls through to the direct --user attempt. If that
also fails with a bus-unavailable message, shouldFallbackToMachineUserScope
returns true and machine scope is tried a second time -- a redundant exec
that was never reachable before this PR opened the fallthrough path.

Add machineScopeAlreadyTried flag and include it in the bottom-fallback
guard condition so the second call is skipped when machine scope was
already attempted in the sudo branch.

Add regression test asserting exactly 2 execFile calls in this scenario.

* fix: keep sudo systemctl scoped

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
8 months ago
Peter Steinberger e0ad3e79e6
refactor: dedupe normalization lowercase helpers 8 months ago
Peter Steinberger bfff74fb11
refactor: dedupe core lowercase helpers 8 months ago
Peter Steinberger eba04199f8
refactor: dedupe core lowercase helpers 8 months ago
Peter Steinberger 572c5b6dd0
refactor: dedupe daemon lowercase helpers 8 months ago
Peter Steinberger 5390eadc4e Tests: fix boundary and late-run drift 8 months ago
Peter Steinberger 74ea9de6f2
refactor: dedupe reply lowercase helpers 8 months ago
Peter Steinberger 829fe14188
refactor: dedupe cli daemon readers 8 months ago
Peter Steinberger 8d05bdda43
refactor: dedupe setup token readers 8 months ago
Peter Steinberger 7f6277b6e5
refactor: dedupe infra cli wizard error formatting 8 months ago
Peter Steinberger 48653c2031 fix: recover launchd restart and restore prompt-cache gate 8 months ago
Peter Steinberger aa497e9c52
refactor: extract daemon launchd recovery helper 8 months ago
Peter Steinberger fd968bfb2d fix: recover unloaded macOS launch agents (#43766) 8 months ago
tmimmanuel 0fef95b17d
fix: preserve Windows scheduled task restart/install behavior (#59335) (thanks @tmimmanuel)
* fix(daemon): preserve Windows Task Scheduler settings on reinstall and exit early on failed restart

* fix(daemon): add test coverage for Create/Change paths, fix early exit grace period

* fix(daemon): fix startup-fallback tests for new isRegisteredScheduledTask call

* fix(daemon): report early restart failure accurately

* fix: preserve Windows scheduled task restart/install behavior (#59335) (thanks @tmimmanuel)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
8 months ago
Peter Steinberger 5e9ae0bfd4
test(node): fix execFile mock typing 8 months ago
Peter Steinberger 323ad51eb8
fix(ci): align execFile mock typings 8 months ago
Peter Steinberger 45a6f769bb
test: trim core partial mocks 8 months ago
Peter Steinberger 13bc70397a
test: trim test partial mocks 8 months ago
Peter Steinberger 3edfc494df
test: expand builtin mock helper usage 8 months ago
Peter Steinberger e0580e6863
test: harden shared-worker runtime setup 8 months ago
Peter Steinberger 1a68e55f47
test: stabilize Windows startup fallback daemon tests 8 months ago
Peter Steinberger 6b6ddcd2a6
test: speed up core runtime suites 8 months ago
Peter Steinberger d014f173f1
test: trim stale legacy coverage and repair mocks 8 months ago
Peter Steinberger 63e5c3349e
refactor(config): drop obsolete legacy config aliases 8 months ago
Anmol Ahuja c40884d306
Prefer non-user writeable paths (#54346)
* infra: trust system binary roots

* infra: isolate windows install root overrides

* infra: narrow windows reg lookup

* browser: restore windows executable comments

---------

Co-authored-by: Jacob Tomlinson <jtomlinson@nvidia.com>
8 months ago
Peter Steinberger 61d29efc04 test: eliminate remaining clone seams 8 months ago
Greg Retkowski 14430ade57
fix: tighten systemd duplicate gateway detection (#45328) (thanks @gregretkowski)
* daemon: tighten systemd duplicate gateway detection (#15849)

* fix three issues from PR review

* fix windows unit tests due to posix/windows path differences
* ensure line continuations are handled in systemd units
* fix misleading test name

* attempt fix windows test due to fs path separator

* fix system_dir separator, fix platform side-effect

* change approach for mocking systemd filesystem test

* normalize systemd paths to linux style

* revert to vers that didnt impact win32 tests

* back out all systemd inspect tests

* change test approach to avoid other tests issues

* fix: tighten systemd duplicate gateway detection (#45328) (thanks @gregretkowski)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
8 months ago
Peter Steinberger ea08f2eb8c
fix(runtime): support Node 22.14 installs 8 months ago
Peter Steinberger 258a214bcb
refactor: centralize daemon service start state flow 8 months ago
Peter Steinberger 94425764a8
refactor: centralize systemd unavailable classification 8 months ago
chocobo9 762fed1f90 fix(daemon): add headless server hints to systemd unavailable error
Add loginctl enable-linger and XDG_RUNTIME_DIR recovery hints to the
generic (non-WSL) systemd unavailable error path, helping users on
SSH/headless servers diagnose and fix the issue without a desktop
session.

Fixes #11805

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 months ago
Peter Steinberger a4327ad544 refactor: dedupe tests and harden suite isolation 8 months ago
Peter Steinberger 5c9e4cd30a
refactor: clarify doctor repair flow 8 months ago
Peter Steinberger 6b9915a106
refactor!: drop legacy CLAWDBOT env compatibility 8 months ago
Peter Steinberger 37d5cbe43a test: trim test startup overhead 8 months ago
Peter Steinberger 29b165e456
refactor: centralize node startup tls planning 8 months ago
Peter Steinberger 40f5305cd2 fix: handle Linux nvm CA env before startup (#51146) (thanks @GodsBoy) 8 months ago
Bob ea15819ecf
ACP: harden startup and move configured routing behind plugin seams (#48197)
* ACPX: keep plugin-local runtime installs out of dist

* Gateway: harden ACP startup and service PATH

* ACP: reinitialize error-state configured bindings

* ACP: classify pre-turn runtime failures as session init failures

* Plugins: move configured ACP routing behind channel seams

* Telegram tests: align startup probe assertions after rebase

* Discord: harden ACP configured binding recovery

* ACP: recover Discord bindings after stale runtime exits

* ACPX: replace dead sessions during ensure

* Discord: harden ACP binding recovery

* Discord: fix review follow-ups

* ACP bindings: load channel snapshots across workspaces

* ACP bindings: cache snapshot channel plugin resolution

* Experiments: add ACP pluginification holy grail plan

* Experiments: rename ACP pluginification plan doc

* Experiments: drop old ACP pluginification doc path

* ACP: move configured bindings behind plugin services

* Experiments: update bindings capability architecture plan

* Bindings: isolate configured binding routing and targets

* Discord tests: fix runtime env helper path

* Tests: fix channel binding CI regressions

* Tests: normalize ACP workspace assertion on Windows

* Bindings: isolate configured binding registry

* Bindings: finish configured binding cleanup

* Bindings: finish generic cleanup

* Bindings: align runtime approval callbacks

* ACP: delete residual bindings barrel

* Bindings: restore legacy compatibility

* Revert "Bindings: restore legacy compatibility"

This reverts commit ac2ed68fa2426ecc874d68278c71c71ad363fcfe.

* Tests: drop ACP route legacy helper names

* Discord/ACP: fix binding regressions

---------

Co-authored-by: Onur <2453968+osolmaz@users.noreply.github.com>
8 months ago
MoerAI 3e8bc9f16a fix(daemon): accept 'Last Result' schtasks key variant on Windows (#47726)
Some Windows locales/versions emit 'Last Result' instead of 'Last Run Result' in schtasks output, causing gateway status to falsely report 'Runtime: unknown'. Fall back to the shorter key when the canonical key is absent.
8 months ago
Peter Steinberger 5c120cb36c
refactor: make setup the primary wizard surface 8 months ago
Peter Steinberger 8ab01c5c93
refactor(core): land plugin auth and startup cleanup 8 months ago
Sally O'Malley 8db6fcca77
fix(gateway/cli): relax local backend self-pairing and harden launchd restarts (#46290)
Signed-off-by: sallyom <somalley@redhat.com>
8 months ago
Josh Avant f4fef64fc1
Gateway: treat scope-limited probe RPC as degraded reachability (#45622)
* Gateway: treat scope-limited probe RPC as degraded

* Docs: clarify gateway probe degraded scope output

* test: fix CI type regressions in gateway and outbound suites

* Tests: fix Node24 diffs theme loading and Windows assertions

* Tests: fix extension typing after main rebase

* Tests: fix Windows CI regressions after rebase

* Tests: normalize executable path assertions on Windows

* Tests: remove duplicate gateway daemon result alias

* Tests: stabilize Windows approval path assertions

* Tests: fix Discord rate-limit startup fixture typing

* Tests: use Windows-friendly relative exec fixtures

---------

Co-authored-by: Mainframe <mainframe@MainfraacStudio.localdomain>
8 months ago
Peter Steinberger e794417623 fix: resolve current ci regressions 8 months ago
Peter Steinberger 5f87b1eba5 test: share schtasks gateway script fixture 8 months ago
Peter Steinberger 49cbcea429 refactor: share daemon launchd and path helpers 8 months ago
Peter Steinberger c90b10b02f test: share daemon cli service helpers 8 months ago
Peter Steinberger e91a5c72de test: share scheduled task stop helpers 8 months ago
Peter Steinberger 4fe59edd84 test: share systemd service test helpers 8 months ago
Val Alexander 158d970e2b
[codex] Polish sidebar status, agent skills, and chat rendering (#45451)
* style: update chat layout and spacing for improved UI consistency

- Adjusted margin and padding for .chat-thread and .content--chat to enhance layout.
- Consolidated CSS selectors for better readability and maintainability.
- Introduced new test for log parsing functionality to ensure accurate message extraction.

* UI: polish agent skills, chat images, and sidebar status

* test: stabilize vitest helper export types

* UI: address review feedback on agents refresh and chat styles

* test: update outbound gateway client fixture values

* test: narrow shared ip fixtures to IPv4
8 months ago