Skip to content

feat(ui): onboarding and Connect wizard hints across surfaces (Spec 109-b) - #1377

Merged
github-actions[bot] merged 29 commits into
mainfrom
109-b-onboarding-connect-hints
Sep 27, 2026
Merged

github-actions[bot] merged 29 commits into
mainfrom
109-b-onboarding-connect-hints

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes the Spec 109-b onboarding gaps by showing client reload guidance and home-shortened config paths, enriching import previews, and requiring an enabled, non-quarantined server with usable health and an approved tool before onboarding treats setup as complete.

The change keeps the connect and import contracts consistent across the Web UI, REST API, CLI, and macOS app. It also makes onboarding state updates transactional and records successful client connections without accepting arbitrary client IDs.

Audit findings and specification

Addresses O2–O6 (connect hints and import summaries) and Spec 109 FR-037, FR-040–044. Implementation details and acceptance criteria: specs/109-ux-navigation-consistency/ (109-b).

Verification

  • go build ./...
  • go test -race -tags server -skip 'E2E|Binary|MCPProtocol|TestInfoEndpoint|TestGracefulShutdownNoPanic|TestSocketInfoEndpoint' ./internal/httpapi
  • npm ci && npm run build && npx vitest run
  • swift test --filter 'ConnectResultHintTests|ConnectClientModelTests|APIClientConnectTests'
  • GitHub CI checks passed on the final PR head.

…g gate

Spec 109 PR 109-b (onboarding-connect-hints):

- connect.ClientDef gains ClientInfoNames and ReloadHint per client;
  connect.DisplayPath shortens a config path to ~ for display.
- ClientStatus/ConnectResult carry display_path and reload_hint on every
  branch (success, already_exists, precondition_failed, disconnect).
- storage.OnboardingState gains a persisted ClientConnectedAt map, and
  BoltDB/Manager/Runtime/Server gain UpdateOnboardingState, a single
  read-modify-write bbolt transaction replacing the separate Get+Save pair
  every onboarding writer used, so concurrent writes never drop a field.
- GET /onboarding/state gains has_usable_server / usable_servers (>=1
  enabled, non-quarantined, connected server with an approved tool); the
  Servers-step badge now keys off it instead of has_configured_server.
- POST /connect/{client} records client_connected_at on success.
…cation

configimport.ImportedServer gains Summary (redacted command+args or
url+auth-type), Tags (local process|remote|needs secret|oauth), and
per-env/header EnvFields/HeaderFields (SecretLike/EmptyOrPlaceholder,
reusing oauth.IsSensitiveKeyName/IsSensitiveHeaderName). Wired into the
REST import preview response and the CLI's JSON import output.
mcpproxy connect <client> / --all now prints "Config: ~/…" and
"Next: <reload_hint>" on success; --all adds CONFIG PATH/NEXT table
columns. mcpproxy connect --list's CONFIG PATH column shows display_path
instead of the raw full path.
make swagger, reflecting ConnectResult.display_path/reload_hint and
ImportedServerResponse.summary/tags/env/headers.
- OnboardingWizard.vue: Servers step completion and tab-picking now use
  has_usable_server (FR-041) instead of has_configured_server; Clients step
  rows show display_path with a full-path tooltip and a per-client icon
  (FR-037); Verify step shows each connected client's reload_hint and
  generates suggested prompts only from usable_servers, with an
  "Approve a server first" fallback (FR-042); import candidate rows show
  the summary second line and tags (FR-040); a one-line telemetry notice
  appears on the final (Verify) step (FR-044).
- TelemetryBanner.vue: hides itself while the wizard is open, sharing one
  dismissal key with the wizard's own notice.
- stores/onboarding.ts: hasUsableServer/usableServers computeds;
  TELEMETRY_BANNER_STORAGE_KEY exported for the shared dismissal key.
- types/api.ts: display_path/reload_hint on ClientStatus/ConnectResult,
  has_usable_server/usable_servers on OnboardingStateResponse,
  client_connected_at on OnboardingState, summary/tags/env/headers on
  ImportedServer.

Not implemented in this PR: the FR-043 import-footer redesign (single
primary + quarantine-uncheck confirmation + Settings summary line) —
the current footer is a previously-audited (F19), heavily-tested design;
redesigning it needs its own focused pass rather than folding it into an
already-large PR.
…try note

APIClient.ConnectResult and ClientStatus decode display_path/reload_hint
(FR-037/FR-042), with effectiveDisplayPath falling back to the full path
for a core that predates the fields. ConnectClientView shows the reload
hint under a successful connect/disconnect. FirstRunDialog gains a
one-line telemetry notice (FR-044) so first-run has an in-flow disclosure
on macOS, matching the Web UI wizard's Verify-step notice.
Verified each reported finding against the code and fixed the genuine
ones test-first; false positives / out-of-scope items are rejected
below with reasons.

Fixed:
- macOS Connect form: the preview pane showed the raw, unshortened
  config path and the success result never rendered the decoded
  display_path/effectiveDisplayPath at all. Added DisplayPath to the
  core's ConnectPreview (internal/connect/preview.go, new
  TestPreviewCarriesDisplayPath) and to ConnectPreviewModel
  (API/ConnectModels.swift), and wired both the preview row and a new
  result row in ConnectClientView.swift to effectiveDisplayPath.
- internal/connect/clients.go DisplayPath: a homeDir of exactly "/"
  (root) collapsed to an empty prefix after TrimRight, making every
  absolute path match "under home" and get wrongly rendered with a
  "~/" prefix. Guarded the degenerate case (new test case in
  TestDisplayPath).
- TelemetryBanner.vue / OnboardingWizard.vue: both are mounted
  together for the whole session on Dashboard.vue, but each read the
  shared telemetry-notice dismissal from localStorage into its own
  independent local ref, only once, on its own mount. Dismissing on
  one surface never propagated to the other already-mounted instance.
  Moved the dismissal into a shared reactive ref on the onboarding
  Pinia store (single source of truth for both components) and added
  a cross-component regression test.
- internal/httpapi/onboarding.go computeUsableServers: called
  ListToolApprovals(name) once per candidate server, and each call
  does a full un-indexed bucket scan (O(S x A) on an endpoint the
  wizard polls every 5s). Switched to one ListToolApprovals("") call
  grouped in memory (O(A)); updated the test mock to model the real
  BoltDB "" = all-servers contract it was missing.
- cmd/mcpproxy/upstream_cmd.go buildImportedServersOutput: always
  emitted "env"/"headers" keys (JSON null when empty), while the REST
  DTO uses `omitempty` and drops them - a CLI/REST shape mismatch
  introduced by this branch's own FR-040 change. Now omits both keys
  when empty, matching the REST DTO (new import_output_shape_test.go).
- internal/configimport/summary.go summarizeServer: the isStdio
  heuristic (Command!=""&&URL=="") disagreed with the runtime's own
  validation (internal/config/config.go), which treats an explicit
  Protocol=="stdio" as authoritative regardless of a leftover URL.
  Mirrored that rule so a hand-edited "type":"stdio" entry with a
  stale url field is tagged "local process" like the runtime treats
  it, not "remote".
- Added missing test coverage the review flagged as a future-regression
  risk (no production behavior changed, all pass against the existing
  code): DisplayPath/ReloadHint on the precondition_failed branch and
  on Disconnect's OpenCode alternate-candidate branch
  (internal/connect/connect_test.go), and the header-specific secret
  matcher path in describeFields (internal/configimport/preview_summary_test.go).
- frontend: added a vitest setup file enabling @vue/test-utils
  enableAutoUnmount so a mounted OnboardingWizard's polling interval
  cannot outlive its test and interfere with a later spec's mocks.

Rejected (kept as-is, with reason):
- onboarding-wizard-import-footer.spec.ts / quarantine-toggle
  confirm-on-uncheck + Settings summary line: genuinely missing, but
  this is new, undesigned UX (a confirmation flow and copy that never
  existed on this branch or main), not a regression in shipped code.
  The reviewer's own note flags it may be intentionally descoped.
  Spun off as a separate follow-up task instead of inventing product
  design under a review-fix commit.
- recordClientConnected's swallowed storage error: already
  best-effort + logged, the same pattern used elsewhere in this
  codebase (e.g. markShown). The finding is speculative about a
  future consumer of client_connected_at, not a present defect.
- Unsynchronized UpdateOnboardingState mocks in httpapi tests: no
  current test exercises these mocks concurrently, and the real
  storage layer already has dedicated atomicity tests
  (internal/storage/onboarding_update_test.go). Hardening test-only
  mocks against a hypothetical future test is out of scope here.
- `-o yaml` missing snake_case struct tags on ConnectResult/
  ClientStatus: pre-existing across the whole struct (never had yaml
  tags), not a regression introduced by this branch; the new fields
  just inherit the existing behavior every other field already has.

Verification: go build (bare + -tags server), go vet, golangci-lint v2
(bare + --build-tags server, no new findings), go test -race across
internal/connect, internal/configimport, cmd/mcpproxy, and
internal/serveredition/config/oauth/server/httpapi/storage under
-tags server with the CI skip regex (all green); frontend npm run
build + npx vitest run (140 files / 1364 tests green); swift test
(pre-existing, unrelated failure in AppLifecycleTests
.testTheSharedJournalNeverWritesToTheRealInstanceRootUnderTests -
environmental, not touched by this diff, confirmed by git diff
--stat on native/macos/); oas/swagger.yaml regenerated with no diff
(ConnectPreview was never part of a documented schema, only
referenced by description string).
Verified each round-2 finding against the code and fixed the genuine ones
test-first.

Fixed:
- FR-043 (specs/109-ux-navigation-consistency, T031) import footer redesign:
  the Servers step still shipped two competing import buttons ("Import
  without review" link + "Import & quarantine" primary) and a global Docker
  isolation + quarantine <details> panel, instead of the one primary button,
  per-import "Quarantine imported servers for review" checkbox (default on,
  confirmed on uncheck), Back, and one-line Settings-linking summary that
  FR-043 spells out as this PR's own declared scope. Round 1 declined this as
  "undesigned UX" spun off to a follow-up task, but no such task exists
  anywhere in the repo (checked docs/, IMPROVEMENTS.md, tracking issues) and
  the behavior is fully specified in FR-043's own text, so it belongs in this
  PR. Replaced the footer with a single "Import N servers" primary button and
  a quarantine checkbox (default checked; unchecking calls window.confirm(),
  matching the existing confirm pattern in Secrets.vue/ServerDetail.vue,
  reverting the checkbox on cancel); replaced the Docker isolation +
  quarantine details panel with a one-line, read-only summary linking to
  /settings (frontend/src/views/settings/fields.ts already exposes both as
  friendly toggles there, so the link is accurate). Added
  frontend/tests/unit/onboarding-wizard-import-footer.spec.ts (T031's
  missing test file) and updated the assertions in the pre-existing
  onboarding-wizard-servers-step.spec.ts that encoded the old two-button/
  details design.
- internal/configimport/summary.go summarizeServer's isStdio heuristic
  disagreed with the runtime's actual transport selector,
  internal/transport.DetermineTransportType, for Protocol=="auto" with a
  command set — reachable via a hand-edited Cursor/Claude-Code config, since
  cursor.go/claude_code.go pass an explicit "type" field through verbatim.
  DetermineTransportType treats "auto" identically to "" and checks Command
  before URL; matched that instead of the previous ad hoc
  Command!=""&&URL=="" rule, whose stated rationale (mirroring
  internal/config/config.go's validation) was also inaccurate — that
  validation branch has no URL condition either. New
  TestImportedServer_AutoProtocolWithCommandIsStdio.
- internal/httpapi/onboarding.go computeUsableServers: round 1's switch to a
  single ListToolApprovals("") call is a real perf win, but bbolt's ForEach
  aborts the whole scan on the first record that fails to decode, so one
  corrupt tool-approval record anywhere now blanked usable_servers for every
  server instead of just the one it belongs to. Added a per-server fallback
  (usableToolServerSet), used only when the aggregate call errors, so a
  corrupt record is isolated to its own server again without reintroducing
  the O(S×A) cost on the common, no-corruption path. New
  TestHasUsableServer_BulkScanErrorFallsBackPerServer.

Verification: go build (bare + -tags server); golangci-lint v2 (bare +
--build-tags server) — zero new findings, all pre-existing baseline issues in
files this change never touches; go test -race for internal/configimport and
internal/httpapi (bare), and -tags server with the CI skip regex across
internal/serveredition, internal/config, internal/oauth, internal/server,
internal/httpapi, internal/storage — all green; frontend npm run build
(vue-tsc + vite) and npx vitest run — 141 files / 1376 tests green;
frontend/package-lock.json left untouched.
Verified each round-3 finding against the code and fixed the genuine ones
test-first.

Fixed:
- frontend/src/components/OnboardingWizard.vue onOpened() reset previews/
  backups/undo state on reopen but left quarantineOnImport, selection and
  selectionImportMessage untouched. The wizard is mounted once by
  Dashboard.vue and only toggled via `:show`, never unmounted, so an
  unchecked-and-confirmed "skip quarantine" choice from one session silently
  carried over — unconfirmed — into the next reopen of the same tab. Reset
  all three alongside the existing session-scoped state. New test in
  onboarding-wizard-import-footer.spec.ts.
- onBulkImport cleared `selection` before building the success toast, and
  the toast's "(N renamed)" suffix reads `conflictCount`, a computed derived
  from `selection` — so it was always 0 by the time the toast fired. Captured
  the count before clearing. New onboarding-wizard-import-conflict-toast.spec.ts.
- The cancel-revert quarantine-checkbox test only asserted the DOM `checked`
  state after cancel, never that an import afterward sends
  skip_quarantine: false. Added that assertion as its own test.
- internal/connect: Disconnect's deferred DisplayPath/ReloadHint fill copied
  every ClientDef.ReloadHint verbatim, and all of them are worded for a
  connect ("...to load MCPProxy") — so a successful disconnect showed
  "reload X to load MCPProxy" right after removing the entry. Added
  disconnectReloadHint() to reword the same reload action for removal
  instead of loading, used by both Disconnect and (new) Undo. New
  TestDisconnectReloadHint_DescribesRemovalNotLoading.
- internal/connect/undo.go: Undo's five ConnectResult literals never set
  DisplayPath/ReloadHint, unlike Connect/Disconnect's deferred fill —
  contradicting ConnectResult.DisplayPath's own doc comment ("populated for
  every result whose ConfigPath is known"). Added the same deferred-fill
  pattern. New TestUndoCarriesDisplayPathAndReloadHint covering all four
  branches (deleted/not_found/restored/conflict).
- internal/configimport/summary.go isStdio still disagreed with the
  runtime's actual internal/transport.DetermineTransportType for
  Protocol ""/"auto" with NEITHER Command nor URL set: DTT's final "default
  to stdio" fallback fires there, but isStdio evaluated false, tagging the
  row "remote". New TestImportedServer_NeitherCommandNorURLIsStdio.
- native/macos ConnectClientModel: ClientStatus.reloadHint was decoded and
  unit-tested (APIClientTests) but nothing read it for a connected row — the
  same "decoded but never rendered" class round 1 fixed on
  ConnectPreview/ConnectResult. A connected row now surfaces its reload hint
  (a real client.note caveat still outranks it), matching the Web UI
  wizard's Verify step, which already shows this for every connected client.
  New testAConnectedRowSurfacesItsReloadHint /
  testACoreNoteOutranksTheReloadHintToo.
- native/macos APIClient.connectConflict(from:) decoded but discarded the
  409 body's display_path/reload_hint, so no conflict/failed ActionState
  could ever carry them even though the core fills both on every
  ConnectResult branch. Extended APIClientError.connectConflict with the two
  fields, added ConnectClientModel.actionDisplayPath/actionReloadHint (reset
  on every beginRequest() and cleared for a generic, non-conflict failure so
  nothing stale survives), and rendered them in ConnectClientView's
  .conflict/.failed branches, reusing the existing resultConfigPath/
  reloadHint accessibility identifiers. Updated
  APIClientConnectTests/ConnectClientModelTests for the new arity; added
  testAGenericFailureCarriesNoStaleDisplayPathOrReloadHint.

Coverage added, no production change needed (the code was already correct):
- internal/storage: TestListToolApprovals_PrefixFilterRunsBeforeDecode
  writes an actual undecodable record into a real bbolt bucket to lock in
  the ordering (filter-by-prefix before decode) that
  internal/httpapi's computeUsableServers fault-isolation fallback depends
  on — the existing test only exercised this through a mock with hardcoded
  errors.

Deferred (genuine finding, not fixed — reasoning below, not a rejection):
- ConnectResultHintTests.swift only decodes model types and never renders
  ConnectClientView or checks its accessibility identifiers, so deleting the
  round-1 render lines would not fail any test in this suite. Investigated a
  render-based fix (NSHostingView + AX-tree walk, following the pattern
  ConnectFormWindowLifecycleTests already uses to host the view). The same
  test run that exercises this pane in this environment logged "Accessibility:
  Not vending elements because elementWindow is lower than shield" for an
  unrelated view — i.e. AX vending is blocked here when a shield window is
  present, which would make an AX-based assertion either flaky or vacuously
  passing (empty tree), exactly the failure mode this finding warns about.
  There is no ViewInspector-equivalent in this repo's Swift test target.
  Closing this properly needs either that dependency or a live
  mcpproxy-ui-test-driven check, not an XCTest addition — left as a known gap
  rather than adding an unreliable test.

Verification: go build (bare + -tags server); golangci-lint v2 (bare +
--build-tags server) on the whole repo — zero new findings, all pre-existing
baseline issues in files this change never touches; go test -race for
internal/connect, internal/configimport and internal/storage (bare and,
for internal/storage, -tags server with the CI skip regex) — all green;
frontend npm run build (vue-tsc + vite) and npx vitest run — 142 files /
1379 tests green; frontend/package-lock.json left untouched; xcodebuild test
for the whole MCPProxy scheme — 1177 tests, 1 failure
(AppLifecycleTests.testTheSharedJournalNeverWritesToTheRealInstanceRootUnderTests),
confirmed pre-existing and environmental by reproducing it identically with
this change's diff stashed out (a real instance-root file already present on
this machine), not introduced by this change.
Fixed:
- cmd/mcpproxy/connect_cmd.go: table-format connect/disconnect output
  printed the raw, un-shortened BackupPath directly above the
  home-shortened "Config: ~/..." line, mixing full and "~"-shortened
  paths in the same block. Now shortens BackupPath the same way.
- internal/configimport/summary.go: ImportedField only carried `json`
  tags, so `-o yaml` (yaml.v3 has no json-tag fallback) rendered
  `valuepresent`/`secretlike`/`emptyorplaceholder` instead of the
  snake_case keys the REST DTO, swagger.yaml and -o json all use.
  Added matching `yaml` tags.
- internal/configimport/summary.go: the EmptyOrPlaceholder doc comment
  (mirrored into oas/swagger.yaml) cites "<TOKEN>" as a recognized
  placeholder, but isPlaceholder's <>{}$ trim reduces it to the bare
  word "token", which was missing from placeholderTokens. Added it so
  the documented example actually matches.

Rejected as false positives:
- Disconnect/Undo's deferred DisplayPath/ReloadHint fill applying to
  no-op refusal results (not_found/conflict): this is the established,
  tested, and explicitly documented design from rounds 2-3 (see the
  "FR-037/FR-042: every ConnectResult this call produces... carries
  the client's display path and reload hint, so a caller never has to
  special-case which branch to trust for them" comments on both
  ConnectWithPrecondition and Disconnect, and
  TestUndo_.../assertHintAndPath which asserts ReloadHint is non-empty
  even on the "conflict" branch). The CLI's table format already
  correctly hides these fields on failure
  (TestPrintConnectResult_FailureHasNoNextLine, round 3); -o json/-o
  yaml and the REST 409 body intentionally return the complete,
  transparent struct for programmatic consumers, consistent with how
  every other raw/structured surface in this codebase behaves. No
  reachable UI currently renders reload_hint from a failed
  disconnect/undo payload (the finding itself could not confirm any
  such path).
- internal/httpapi/import.go ImportedServerResponse.Tags/Summary
  lacking `omitempty`: these are intentionally always-populated
  fields, matching sibling required fields like Name/Protocol/
  SourceFormat/OriginalName (none of which have omitempty either) -
  unlike Env/Headers, which are genuinely optional. summarizeServer
  always initializes Tags to a non-nil, non-empty slice, so this is
  unreachable in every current code path, as the finding itself notes.
Regenerate oas/swagger.yaml and oas/docs.go, which were stale relative
to the doc-comment update on configimport.ImportedField.EmptyOrPlaceholder
made in the round-4 fix commit (424fa3a00). That comment is mirrored
into the OpenAPI spec, and make swagger-verify failed on HEAD because
the regenerated artifacts were never committed alongside the source
change.

No source or contract shape change: go run ./cmd/generate-types
produces no diff in frontend/src/types/contracts.ts.
Servers step showed the generic "Nothing to import" dead end (Browse the
registry / Add a server manually) whenever there were no new import
candidates left, even when the reason was that everything already imported
sat in quarantine. Both correctly-quarantined servers left has_usable_server
false and the step un-checked, but the body gave the user nowhere to go: no
list of what was already imported, no hint to approve it.

Add a scoped inline review list for that state: when import candidates are
exhausted and has_usable_server is still false because quarantined servers
exist, show "Approve a server to finish this step." with a row per
quarantined server (name, command/url, Quarantined badge) and a Review link
into the existing, fully-featured Servers-page approve flow. This is a
stand-in for the full cross-surface review screen (a separate, later PR);
it deliberately reuses the existing approve path on the Servers page rather
than reimplementing its scan-gate/force-approve confirmation here.

Live-verified on a fresh isolated instance (scratch HOME/data/config): two
quarantined servers (github http, filesystem stdio) render as an inline
review list with working per-server Review links, replacing the dead end.

Regression test: onboarding-wizard-inline-review.spec.ts.
@codecov-commenter

codecov-commenter commented Sep 25, 2026 •

Copy link
Copy Markdown

All 5 findings verified against the code and fixed test-first; a zcode
review round on the fix caught two further real regressions (modifier/
middle-click and missing router base on the new plain <a> links), which
are folded into the same commit rather than a separate round.

- cmd/mcpproxy/connect_cmd.go: connectAllClients (--all, table format)
  printed CONFIG PATH/NEXT for every result including failures (e.g.
  action=already_exists). Extracted connectAllClientRow(r), blanking
  both columns when !r.Success, matching printConnectResult's
  single-client behavior. Test: TestConnectAllClientRow_FailureHasNoConfigOrNext.

- internal/configimport/summary.go: authType was "header auth" whenever
  a server had ANY header (len(Headers) > 0), ignoring the per-header
  SecretLike classification headerFields already carries via
  oauth.IsSensitiveHeaderName. Added anySecretLike(fields); a
  non-credential header (e.g. X-Client-Name) is now "no auth". Tests:
  TestImportedServer_NonSecretHeaderIsNotHeaderAuth,
  TestImportedServer_SecretHeaderIsHeaderAuth.

- frontend/src/components/OnboardingWizard.vue: three router-links
  (inline-review Review link, FR-043 Settings summary link, Verify
  step's review-on-Servers-page link) navigated away without calling
  dismiss() first, unlike goToRegistry(), which unmounts the Dashboard
  that owns wizardOpen before dismiss() can emit close — the wizard
  would spring back open. Added goToServerReview/goToSettings/
  goToServersList mirroring goToRegistry. Follow-up from zcode review:
  a plain @click.prevent intercepted every click including cmd/ctrl/
  shift/middle-click, breaking "open in new tab"; handlers now check
  isPlainLeftClick and only preventDefault for a real in-app
  navigation, and hrefFor() gives the anchors a real router-base href
  (falling back to the bare path when no router is installed, for unit
  tests that mount the component standalone).

- native/macos/MCPProxy/MCPProxy/Views/ConnectClientModel.swift: undo()'s
  catch was generic and never pattern-matched APIClientError.connectConflict,
  unlike connect()'s catch, so a 409 from POST /connect/{client}/undo
  (config drifted since the connect) discarded display_path/reload_hint.
  Added the same catch-and-branch connect() uses; undoState is left
  untouched on conflict so the retry affordance stands (no re-preview —
  undo has no preview/token machinery to refresh). Test:
  testUndoConflictSurfacesDisplayPathAndReloadHint. Also corrected the
  test fixture's action string to "conflict" (the real undo.go wire
  value) per zcode review.

- internal/httpapi/onboarding.go + oas/: GET/POST onboarding/state and
  onboarding/mark were annotated with a bare contracts.APIResponse, so
  OnboardingStateResponse (has_usable_server, usable_servers, etc.) was
  absent from the OpenAPI spec unlike every other new field this PR
  added. Changed both to contracts.APIResponse{data=OnboardingStateResponse}
  and regenerated oas/swagger.yaml + oas/docs.go via `make swagger`
  (purely additive: 2 new component schemas, same allOf/$ref pattern
  every other {data=X} endpoint in this file already uses).

Verification: go build ./... and -tags server both clean; go test -race
on cmd/mcpproxy, internal/configimport, internal/httpapi, plus the full
-tags server -race run across serveredition/config/oauth/server/httpapi/
storage (all ok); golangci-lint v2 bare and --build-tags server (only
pre-existing, unrelated findings in untouched files); frontend
npm run build + npx vitest run (1386 tests, 0 unhandled errors);
swift test (1178 tests, 1 pre-existing unrelated failure — this dev
machine's own live tray instance writes to the real ~/.mcpproxy path
the AppLifecycleTests journal-isolation test asserts is untouched, an
environmental collision, not a regression).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Round 6 finding (medium): `mcpproxy connect` writes a client's config
file directly via internal/connect.Service, bypassing
POST /api/v1/connect/{client} entirely (by design, so the command keeps
working with no daemon running). That meant it never reached
handleConnectClient's recordClientConnected, so
storage.OnboardingState.ClientConnectedAt (FR-042) only ever reflected
Web UI / tray connects, never CLI ones — a real cross-surface parity
gap, confirmed against the code and the FR-042 doc comment (no door
qualification).

Fix: `mcpproxy connect` and `--all` now best-effort relay a successful
write to a running daemon via POST /api/v1/onboarding/mark's new
connected_client_id field (validated against the fixed connect client
registry, same bound as the existing map). The relay only fires when a
daemon is reachable (reusing the existing socket/TCP daemonEndpoint
detection) and never surfaces a failure — the connect write already
succeeded and was already reported to the user by the time this runs.
No fallback to opening config.db directly when no daemon is running:
it is exclusively locked while one runs, so a fallback could only ever
apply to the case where nothing reads the state until the next daemon
start anyway.

Shared the map-write between the REST path (recordClientConnected) and
the new CLI relay via one applyClientConnected helper so both writers
stay identical.

Regenerated oas/swagger.yaml/docs.go for the new request field; no
frontend contract change (OnboardingMarkRequest is not part of the
generated contracts.ts surface).

Tests added test-first: internal/httpapi onboarding_test.go covers the
new field (valid id recorded, unknown id rejected with the write
untouched, combines with other mark fields in one transaction);
cmd/mcpproxy connect_notify_test.go covers the CLI relay (reachable
daemon receives it, unreachable daemon and wrong API key are silent
no-ops).

Verification: go build ./... (bare and -tags server); go test -race on
cmd/mcpproxy and internal/connect; go test -race -tags server with the
CI -skip regex on internal/httpapi; golangci-lint v2 bare and
--build-tags server on both touched packages (one pre-existing
staticcheck SA1019 in internal/httpapi/contracts_test.go, unrelated to
this change and not touched by it). Frontend and native macOS
unchanged, so their verification steps do not apply.
…ect-hints

# Conflicts:
#	frontend/src/components/OnboardingWizard.vue
#	oas/docs.go
…serHomeDir

os.UserHomeDir() reads %USERPROFILE% on Windows, not $HOME, so the test's
t.Setenv("HOME", home) left the real Windows profile dir as home when
connect.DisplayPath(path, "") fell back to os.UserHomeDir(), causing the
backup path assertion to fail on windows-latest CI (Unit Tests, Build
Binaries) while passing on macOS/Linux.
…mport footer

Spec 109-b's server-step footer (FR-043) replaced the old two-button
choice (data-test=bulk-import-active / bulk-import-quarantine) with one
primary action (data-test=bulk-import-primary) plus a quarantine
checkbox. main's self-import-skip test (onboarding-wizard-skip-reason-label)
still targeted the old button id after the merge; point it at the
current one so the merged component's own tests exercise the actual UI.
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 109-b-onboarding-connect-hints

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (24 MB)
  • installer-dmg-darwin-arm64 (22 MB)
  • smart-mcp-proxymcpproxy-go9BVZSH.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 36326526936 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

- onboarding: decode the mark-endpoint body via decodeOptionalJSONBody
  instead of gating on r.ContentLength > 0, which silently skipped a
  chunked-encoding POST (ContentLength == -1) and returned 200 OK with
  a no-op write, dropping engaged/step-status updates and the
  connected_client_id relay.
- configimport: flag a bare shell-style env-var indirection like
  "${GITHUB_TOKEN}" (no colon) as a placeholder. mcpproxy's own secret
  resolver requires a "type:name" form and never resolves it, so it was
  previously shown as fully configured and copied verbatim into the
  child process's environment.
- connect: make DisplayPath's home-prefix match case-insensitive on
  Windows (via an overridable caseInsensitiveHomeMatch, so the behavior
  is tested on every platform), since Windows paths are case-insensitive
  and %USERPROFILE%/%APPDATA% can legitimately differ in casing.
- connect: add `yaml` struct tags to ConnectResult/ClientStatus matching
  their `json` tags, so `mcpproxy connect ... -o yaml` renders the
  documented snake_case keys instead of yaml.v3's collapsed defaults
  (displaypath, reloadhint, ...).

All four fixes are test-first: each adds a failing test reproducing the
reported gap before the fix, per zcode review round 1 on
109-b-onboarding-connect-hints (findings 1-4, all medium severity).

No REST contract shape changes (json tags unchanged), so swagger.yaml
and frontend generated types are unaffected.
…indows branch

The test asserted the default (non-overridden) caseInsensitiveHomeMatch
behaves case-sensitively, but that default resolves through
runtime.GOOS == "windows" — true on an actual windows-latest CI runner,
where the test then fails since the code path under test genuinely
becomes case-insensitive. Override caseInsensitiveHomeMatch explicitly
to false, matching the sibling override test's pattern, so the
case-sensitive branch is exercised on every CI platform.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved (Model B): Paperclip review verdicts = ACCEPT and qa-gate green at this head SHA. Arming auto-merge; GitHub merges when all required checks pass.

@github-actions
github-actions Bot merged commit a045060 into main Sep 27, 2026
63 of 64 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 29, 2026
Resolves the remaining low-priority findings deferred from #1377.

- `connect --all`: resolve the daemon once and relay all clients
concurrently under a single deadline, instead of one synchronous probe +
POST per client.
- Onboarding wizard: a tab the user picks while the open-time fetches
are pending is no longer overwritten by the computed initial tab.
- macOS first-run dialog: window height is derived from the content's
fitting size (minimum 300) instead of a fixed 300.
- Connect registry: `GetAllClients`/`FindClient` deep-copy
`ClientInfoNames`.
- `UpdateOnboardingState`: document the callback constraint (no
re-entering Manager/BoltDB, short and pure) on both the Manager and
BoltDB methods.
- Import placeholders: embedded `${VAR}` and whole-value `$VAR` count as
unresolved placeholders; `${type:name}` refs and values that merely
contain `$` are unaffected.
- Connect modal: show `display_path` (full path kept as tooltip) in the
row, preview and disconnect confirmation; render the reload hint
returned by a disconnect.
- Import apply response: overrides are applied before the response is
built and the env/header classification, summary and tags are recomputed
(`configimport.Reclassify`).
- CLI import JSON omits an empty `summary`, matching the REST DTO.
- macOS disconnect confirmation shows the home-shortened `display_path`.

Closes #1404
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