Skip to content

feat: add per-account test messages and responsive quota actions - #15138

Merged
diegosouzapw merged 13 commits into
diegosouzapw:release/v3.8.52from
JxnLexn:dev/connection-test-message-upstream
Oct 8, 2026
Merged

diegosouzapw merged 13 commits into
diegosouzapw:release/v3.8.52from
JxnLexn:dev/connection-test-message-upstream

Conversation

@JxnLexn

@JxnLexn JxnLexn commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a manual Test message action to each provider connection and Provider Quota card. Operators select and save a default chat model per account directly in Edit Connection (or in the test dialog), set one shared message in Settings → AI, send a real request and see its answer. The default asks for 1 + 1 with a numeric answer. This can start an upstream usage window; the provider determines its timing.

Requests use only the selected account, bypass response caching and do not fall back to another account. Opening the dialog or saving settings never generates traffic. Disabled accounts cannot send; repeated concurrent clicks are rejected. The existing model-test runner supplies timeout handling, short output limits and sanitized errors.

Quota actions now use a responsive grid, with the refresh control beside the update timestamp, so narrow cards keep every action visible and clickable.

Related Issues

⚠️ base-red inherited: #15100

Validation

  • Change type: UI / API / i18n
  • Reconciled with release/v3.8.52 at 453918ab64; existing release changes preserved
  • Production changes include automated tests
  • Native focused suite: node --import tsx/esm --import ./tests/_setup/isolateDataDir.ts --test tests/unit/connection-test-message.test.ts tests/unit/model-test-route.test.ts — 10 passed
  • npm run test:vitest — 493 passed
  • UI interactions and headless geometry: RUN_QUOTA_LAYOUT=1 npx vitest run --config vitest.config.ts tests/unit/ui/connection-test-message.test.tsx — 6 passed, English and German at 230/280/320/380px card widths
  • Layout regression test fails against the previously deployed footer and passes with this change
  • npm run typecheck:core, npm run check:dashboard-typecheck, changed-file ESLint, OpenAPI coverage/security tiers, i18n coverage/value-drift/glossary and fabricated-document checks
  • npm run lint — five inherited react-hooks/immutability errors in unchanged hook test files (use-improve-prompt, use-presets, use-stream-metrics, use-structured-output, use-tools-builder); changed-file ESLint passes
  • Fork production image build — GitHub run 36618804555, deployment revision e83ef183709af44018a7533c79ac4d5cd93ae892
  • API Route Typecheck CI — run 36620212729
  • Live deployment and UI verification on the production fork: healthy container, authenticated dashboard works
  • Connections dialog saved gpt-6-luna for the selected Pro account without sending; Provider Quota loaded the same saved model and sent exactly one request. HTTP 200, answer 2, latency 1204 ms; account remained active with no recorded auth error
  • Live layout: 52 action targets checked at 390/768/1024/1440px viewports in both full and compact modes; no clipped or covered action targets after layout settled. AI Settings displayed the effective default prompt

npm run check:docs-all reaches the inherited documentation-count failure: README and llm.txt still claim 3.8.51 while the release package is 3.8.52. The complete native suite, coverage matrix and upstream production build are left to CI.

Tests Added Or Updated

  • tests/unit/connection-test-message.test.ts: management auth, per-account persistence, exact account selection, custom message, cache bypass, no fallback on failure, duplicate requests, inactive accounts, validation and paid-model policy.
  • tests/unit/ui/connection-test-message.test.tsx: configuration versus sending, response display, disabled/unavailable models, global message persistence and quota action handlers.
  • tests/helpers/assertQuotaCardLayout.cjs: opt-in headless geometry and edge hit-testing. Uses the installed Playwright browser, or PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH when explicitly supplied; no desktop browser window is opened.

Coverage Notes

The API tests exercise the real internal chat pipeline with mocked upstream responses. UI tests cover user interactions; the opt-in browser check verifies actual rendered sizes and click targets.

Reviewer Notes

No schema migration or scheduler is added. The chosen model is stored as providerSpecificData.connectionTestModel; the shared message is stored as connectionTestPrompt with a 500-character limit. The connection form reads the current model when opened; only an explicitly edited model is written back, so unrelated saves cannot overwrite a newer selection from the test dialog. Cancel discards the draft. English and German copy is included; other locales use the existing English fallback. Each send is a real, quota-consuming request. The new endpoint is management-authenticated and documented in OpenAPI.

Live verification used node /tmp/verify-connection-test-ui.cjs, followed by the read-only node /tmp/verify-quota-layout-live.cjs and node /tmp/verify-quota-compact-live.cjs headless checks. The first combined run measured geometry immediately after closing the answer dialog and reported an obstructed hit target; the settled-page checks above passed for both layouts. No additional inference was sent during those layout checks. The upstream API type annotations transpile to the same runtime JavaScript as the deployed fork endpoint.

Follow-up validation for the connection-settings field: 9 focused native tests passed (including save/preserve/clear through the actual connection PUT route), 9 UI interaction tests passed (OAuth and API-key accounts, fresh preset, Save, Cancel/reopen and clearing), changed-file ESLint and the dashboard type gate passed. The follow-up image was built successfully in GitHub run 36621947961 and deployed at revision e1af47441007cf9ba0dda1a8737e8f89ddf14a00. Live headless verification (node /tmp/verify-connection-default-live.cjs) confirmed the new Edit Connection field, the persisted gpt-6-luna default, and that Cancel/reopen restores that default. This follow-up UI check sent zero model requests and made zero server writes.

@JxnLexn
JxnLexn marked this pull request as ready for review September 29, 2026 19:41
JxnLexn and others added 7 commits October 2, 2026 01:49
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
… EditConnectionModal under its frozen size

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…locales

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit 303f5f6 into diegosouzapw:release/v3.8.52 Oct 8, 2026
5 checks passed
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @JxnLexn — merged into release/v3.8.52; it ships in the next release. FYI we also extracted a type out of EditConnectionModal.tsx to keep it under its frozen size, and translated the 20 new connectionTest.* keys for the other locales in your branch.

diegosouzapw added a commit that referenced this pull request Oct 8, 2026
Drains 9 v3.8.52 tip unit reds: 3 production defects — MCP bundle startup deadlock (async ESM init cycle from #13739; lazy-load cleanModelName), client bundles pulling server-only DB via imageRegistry→featureFlags (#15423; dependency-free resolver bridge, DB override preserved, default OFF), zh-CN/zh-TW glossary violations (#15138/#15092) — plus regenerated route namespaces, env-isolated guide-settings test, auth-test alignments that keep (and tighten to count=2) the loopback/management guards, quota-card guard following #15138 redesign, and stryker listing of 2 tip covering tests. Combined-board validation with #15903: 327/329 on the previously red files, typechecks, lint, 22 gates.
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