Skip to content

fix(etoro): runtime UI parity for SDK connector status - #1051

Open
ofeksh-tr wants to merge 2 commits into
HKUDS:mainfrom
ofeksh-tr:feat/etoro-runtime-ui
Open

fix(etoro): runtime UI parity for SDK connector status#1051
ofeksh-tr wants to merge 2 commits into
HKUDS:mainfrom
ofeksh-tr:feat/etoro-runtime-ui

Conversation

@ofeksh-tr

@ofeksh-tr ofeksh-tr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add eToro check_status verify envelope (configured, connection_state, error_code, credential_source, last_checked_at) so /live/status and the Agent connector panel can surface eToro like other SDK brokers.
  • Show broker-specific missing-credential guidance on /runtime for eToro (env vars + ~/.vibe-trading/etoro.json) instead of Longbridge-only hints.
  • Treat broker_sdk connectors as connected in the Agent Connector Runtime panel when connection_state is connected/ready, without OAuth on-ramp noise.
  • Keep configured: true when credentials exist but the API returns auth errors (Longbridge parity).
  • Fix DELETE /scheduled-runs/{job_id} to return an empty Response on 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 requires etoro-live-trade and a committed mandate.

Changes

  • Backend: etoro/sdk.py check_status, live_routes.py path_separated_key_bound, scheduled_routes.py 204 fix, test_etoro_connector.py, test_etoro_runtime.py
  • Frontend: Runtime.tsx setup hints, RunnerStatus.tsx SDK connected state, i18n (5 locales), component tests

Test Plan

  • pytest agent/tests/test_etoro_connector.py -q
  • cd frontend && npx vitest run src/components/chat/__tests__/RunnerStatus.test.tsx
  • pytest agent/tests/test_etoro_runtime.py -q (CI; uses repo-pinned TestClient)
  • pytest --ignore=agent/tests/e2e_backtest --tb=short -q (CI full suite)
  • Manual: /runtime shows eToro connected with runtime_file credentials; Agent panel shows Connected for SDK brokers

Risk / rollback

  • Risk: Read-only diagnostics and UI only; no order-gate or mandate enforcement changes.
  • Rollback: git revert the five commits on this branch.

Checklist

  • No changes to protected areas without prior discussion
  • No hardcoded secrets or credentials in the diff
  • DCO Signed-off-by on all five commits
  • CONTRIBUTING.md style (ruff clean on changed Python files)

@warren618 warren618 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

ofeksh-tr and others added 2 commits August 11, 2026 11:11
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>
@ofeksh-tr

Copy link
Copy Markdown
Contributor Author

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.

Done thanks for the feedback!

@ofeksh-tr
ofeksh-tr requested a review from warren618 August 11, 2026 12:05
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