fix(etoro): runtime UI parity for SDK connector status - #1051
Conversation
warren618
left a comment
There was a problem hiding this comment.
Thanks for this — the core fix is real, and I verified it against main: eToro's PAPER_GUARD is path_separated_key_bound (agent/src/trading/connectors/etoro/client.py:29), but that value isn't in _ENVIRONMENT_IDENTITIES (agent/src/api/live_routes.py:222), so _closed_vocabulary() normalises it to null and the Runtime page renders the environment as Unknown. That one-line addition plus the new configured / connection_state / error_code fields close a genuine user-visible gap. I also checked that every new value lands inside the closed vocabularies in live_routes.py, that all five locales stay key-parity clean, and that the sentinel test really does prove no credential reaches the status payload.
Two things I'd like changed before merging:
1. Please drop the unrelated reformatting. 39 of the 61 Python hunks here are pure formatting (+139/-41 — about 34% of the touched Python lines), reflowed to ~88 columns. This project's standard is line-length = 120 (pyproject.toml) with E501 ignored, and CI runs no format check, so nothing requires these hunks — they just make the substantive change hard to review and hard to bisect later. A few are also strictly worse, e.g. "job id must be 1-128 characters of letters, digits, " "'_' or '-'" in scheduled_routes.py.
2. Please split out the scheduled_routes.py change. It's unrelated to eToro. I checked what it actually does: the existing -> None handler already returns a correct empty 204 — the explicit Response(status_code=204) only drops a stray Content-Type: application/json header. That's a reasonable fix, but it deserves its own PR with a test asserting the header (test_scheduled_routes.py currently covers the status code and the empty body, but not the content type).
Once the diff is just the eToro runtime-parity change, this is good to merge.
Expose configured, connection_state, error_code, credential_source, and last_checked_at for GET /live/status. Load env credentials via get_env_config(), add credential_source helpers, and register path_separated_key_bound in live_routes environment identities. Signed-off-by: Ofek Shaked <ofeksh@etoro.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Show broker-specific setup hints on /runtime, treat broker_sdk connectors as connected in the Agent Connector Runtime panel, and add frontend tests plus i18n for five locales. Signed-off-by: Ofek Shaked <ofeksh@etoro.com> Co-authored-by: Cursor <cursoragent@cursor.com>
9d63b21 to
e9f79ca
Compare
Done thanks for the feedback! |
Summary
check_statusverify envelope (configured,connection_state,error_code,credential_source,last_checked_at) so/live/statusand the Agent connector panel can surface eToro like other SDK brokers./runtimefor eToro (env vars +~/.vibe-trading/etoro.json) instead of Longbridge-only hints.broker_sdkconnectors as connected in the Agent Connector Runtime panel whenconnection_stateisconnected/ready, without OAuth on-ramp noise.configured: truewhen credentials exist but the API returns auth errors (Longbridge parity).DELETE /scheduled-runs/{job_id}to return an emptyResponseon 204 (FastAPI import/startup on current releases).Why
eToro was merged as a connector (#989) but did not appear in the Agent UI and showed incorrect Longbridge setup text on
/runtime. SDK key-based brokers were labeled "Not connected" with OAuth instructions even when credentials were valid.Closes the runtime UI parity gap for eToro; read-only status remains the default on
/runtime(etoro-live-sdk-readonly). Live trading still requiresetoro-live-tradeand a committed mandate.Changes
etoro/sdk.pycheck_status,live_routes.pypath_separated_key_bound,scheduled_routes.py204 fix,test_etoro_connector.py,test_etoro_runtime.pyRuntime.tsxsetup hints,RunnerStatus.tsxSDK connected state, i18n (5 locales), component testsTest Plan
pytest agent/tests/test_etoro_connector.py -qcd frontend && npx vitest run src/components/chat/__tests__/RunnerStatus.test.tsxpytest agent/tests/test_etoro_runtime.py -q(CI; uses repo-pinned TestClient)pytest --ignore=agent/tests/e2e_backtest --tb=short -q(CI full suite)/runtimeshows eToro connected withruntime_filecredentials; Agent panel shows Connected for SDK brokersRisk / rollback
git revertthe five commits on this branch.Checklist
Signed-off-byon all five commits