Repository navigation
One wiring profile and one saved connection across web, CLI, SDK and MCP - #27
Merged
Merged
Conversation
- A LAN/USB BenchPod now uses the wiring profile stored on embeddedci.com for the device the pod reports in cloud_status, when BENCHPOD_API_KEY, a caller's user token or the `benchpod login` session is available. wiring=/BENCHPOD_WIRING still win; every failure logs and falls back to the defaults within ~3 s. New wiring_source= / BENCHPOD_WIRING_SOURCE=local opt-out. - BenchPod() falls back to the connection benchpod-cli saved (~/.config/benchpod-cli/config.json, read-only): argument > BENCHPOD_CONNECTION > saved. The "saved" connection string names it; the pytest plugin only uses it when asked (--benchpod-connection=saved). - MCP connect: argument > --connection > BENCHPOD_CONNECTION > saved > mDNS; the login is handed to the SDK on LAN/USB too; connect/status report wiring_source. - New SDK modules cli_config and cli_login; READMEs, CHANGELOGs (behavior changes), tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UX plan tier 4: the web UI, the CLI, the SDK and the MCP server agree on which pod to use and which wiring profile it has.
One wiring profile
bp.wiringresolves, first match wins:wiring=argument (pytest:--benchpod-wiring, then thebenchpod_wiringfixture)BENCHPOD_WIRINGfilesource == "server":embeddedci:<device>): that device (unchanged)cloud_status, whenapi_key=/BENCHPOD_API_KEY,cloud_user_token=or thebenchpod loginsession is available and the device is on that accountStep 3 never raises: no credentials, pod not registered, server unreachable, 401/403/404 or a bad profile all log why and use the defaults. On LAN/USB the whole lookup (
cloud_status+ one GET) has a ~3 s budget; the transport timeouts are restored afterwards. Opt-out:wiring_source="local"/BENCHPOD_WIRING_SOURCE=local(skips the server lookup for every connection kind).One saved connection
BenchPod()picks:connectionargument >BENCHPOD_CONNECTION> the connectionbenchpod-clisaved (benchpod set-connection,~/.config/benchpod-cli/config.json,$XDG_CONFIG_HOMErespected;connection, else legacybench_pod_addr). Read-only; missing/malformed file = nothing saved. The connection stringsavednames it explicitly.The pytest plugin does not use the saved connection implicitly (no connection still skips the hardware fixtures); opt in with
--benchpod-connection=saved.MCP
connect: argument >--connection>BENCHPOD_CONNECTION> CLI saved connection > mDNS. Thebenchpod loginsession is handed to the SDK for LAN/USB connections too (only when a login exists), andconnect/statusreportwiring_source.Behavior changes (in both CHANGELOGs)
bp.wiringaccess makes onecloud_statuscall and one HTTP request.BenchPod()without a connection used to raiseConnectionConfigError; it now connects to the CLI's saved pod when there is one.connect()without a connection goes to the CLI's saved pod before mDNS.Compatibility
wiring_source=onBenchPod, modulesembeddedci.benchpod.cli_configandembeddedci.benchpod.cli_login(api_surface.json refreshed). The MCP tool surface gainsStatusResult.wiring_source.embeddedci>=2.9: the saved connection is read via a guarded import, and the new MCP tests skip on an SDK withoutcli_config. Verified against embeddedci 2.9.0 from PyPI (147 passed, 17 skipped).XDG_CONFIG_HOMEat a temp dir (not for e2e/examples), so a developer's saved connection or login never leaks into unit tests.Tests
pytest packages/embeddedci: 600 passed, 175 skippedpytest packages/embeddedci-mcp: 152 passed, 12 skippedpytest packages/embeddedci-openhtf: 74 passed, 3 skipped;pytest scripts: 12 passedbenchpod loginsession:bp.wiring.source == "server"in 0.41 s, equal to the profileGET /benchpod/devices/{id}/wiring/profilereturns (storeduart_rx: 3, where the defaults say 5).wiring_source="local"gives the defaults. Over USB (fw 3.8.0 text console)cloud_statusis unavailable, so the defaults apply (logged at info).🤖 Generated with Claude Code