picoclaw/web/backend/api
SiYue b4a5965602 refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming
Address latest review comments from sky5454 in PR #2654.

scripts/copydir.go:

- Improve repository root detection in a safer, more deterministic way.

- Prefer locating repo root from the script source path via runtime.Caller(), then fallback to upward search from current working directory.

- Replace .git-only root detection with repository anchor validation: go.sum, LICENSE, and .github must exist.

- Keep \ placeholder expansion and existing in-repo path guards.

- Preserve destination safety check to prevent deleting/copying to repo root.

web/backend/api:

- Rename applyLauncherWindowsProcAttrs() to applyLauncherProcAttrs() to expose a platform-independent interface name.

- Keep platform-specific behavior split by build tags: windows keeps HideWindow SysProcAttr setup, non-windows remains no-op.

- Update gateway startup path to call the renamed helper.

Why:

- Follow reviewer feedback to avoid relying on .git detection alone and prefer runtime/file-anchor based repository location.

- Improve naming clarity by making cross-platform interfaces generic while preserving OS-specific implementation details internally.

Validation:

- go test ./cmd/picoclaw/internal/onboard

- go test ./web/backend/api
2026-04-25 00:31:36 +08:00
..
auth.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
auth_login_limiter.go feat(web): protect launcher dashboard with token and SPA login (#1953) 2026-03-29 13:11:43 +08:00
auth_test.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
channels.go fix(web): save channel configs with nested channel_list patches (#2530) 2026-04-16 10:30:16 +08:00
channels_test.go fix(web): save channel configs with nested channel_list patches (#2530) 2026-04-16 10:30:16 +08:00
config.go feat(web): support list editing for channel array fields (#2595) 2026-04-21 16:04:28 +08:00
config_test.go feat(web): support list editing for channel array fields (#2595) 2026-04-21 16:04:28 +08:00
exec_nonwindows.go refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming 2026-04-25 00:31:36 +08:00
exec_windows.go refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming 2026-04-25 00:31:36 +08:00
gateway.go refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming 2026-04-25 00:31:36 +08:00
gateway_host.go fix(web): improve Pico URL and origin handling behind proxies 2026-04-20 10:11:03 +08:00
gateway_host_test.go fix(web): improve Pico URL and origin handling behind proxies 2026-04-20 10:11:03 +08:00
gateway_test.go refactor(web): secure Pico websocket access behind launcher auth 2026-04-20 10:11:03 +08:00
launcher_config.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
launcher_config_test.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
log.go refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
model_status.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
model_status_test.go fix(api): enhance model availability probing with backoff and caching mechanisms (#2231) 2026-04-01 14:15:28 +08:00
models.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
models_test.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
oauth.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
oauth_test.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
pico.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
pico_test.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
router.go Keep launcher locale changes from mutating shared web-search routing (#2573) 2026-04-24 13:45:25 +08:00
session.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
session_test.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
skills.go refactor skills registries and add GitHub-backed skill discovery (#2442) 2026-04-14 15:14:16 +08:00
skills_test.go refactor skills registries and add GitHub-backed skill discovery (#2442) 2026-04-14 15:14:16 +08:00
startup.go feat(web): add service log level controls (#2227) 2026-03-31 20:32:42 +08:00
startup_test.go feat(web): add service log level controls (#2227) 2026-03-31 20:32:42 +08:00
tools.go fix(tools): improve web search provider fallback (#2629) 2026-04-23 15:39:16 +08:00
tools_test.go Keep launcher locale changes from mutating shared web-search routing (#2573) 2026-04-24 13:45:25 +08:00
update.go feat(updater): robust self-update selection & extraction (nightly default) (#2201) 2026-04-01 23:41:32 +08:00
version.go feat(web): display backend version info in sidebar (#2087) 2026-03-30 16:44:50 +08:00
version_test.go feat(web): display backend version info in sidebar (#2087) 2026-03-30 16:44:50 +08:00
wecom.go refactor(config): make config.Channel to multiple instance support 2026-04-13 22:21:21 +08:00
weixin.go fix some bugs: 2026-04-14 00:15:35 +08:00
weixin_test.go refactor(config): make config.Channel to multiple instance support 2026-04-13 22:21:21 +08:00