Commit Graph

4229 Commits

Author SHA1 Message Date
RockChinQ 2356086550 Merge pull request #2585 from langbot-app/fix/pin-sdk-0.6.7
fix(plugin): pin runtime SDK 0.6.7
2026-09-26 14:26:42 +08:00
RockChinQ 92669ef584 fix(plugin): pin runtime SDK 0.6.7 2026-09-26 06:19:15 +00:00
RockChinQ aad78767cd Merge pull request #2584 from langbot-app/fix/pin-sdk-0.6.6
fix(plugin): pin runtime SDK 0.6.6
2026-09-26 13:29:25 +08:00
RockChinQ 37e80e510f fix(plugin): pin runtime SDK 0.6.6 2026-09-26 05:21:50 +00:00
RockChinQ f34814270c Merge pull request #2583 from langbot-app/fix/pin-sdk-0.6.5
fix(plugin): pin runtime SDK 0.6.5
2026-09-26 12:36:55 +08:00
RockChinQ 9690f0bc6c fix(plugin): pin runtime SDK 0.6.5 2026-09-26 04:29:05 +00:00
RockChinQ dd88a54118 Merge pull request #2581 from langbot-app/fix/pin-sdk-0.6.4
fix(plugin): pin runtime SDK 0.6.4
2026-09-26 10:10:07 +08:00
RockChinQ ede433f0b1 fix(plugin): pin runtime SDK 0.6.4 2026-09-25 22:34:08 +00:00
RockChinQ 19634d3f54 Merge pull request #2580 from langbot-app/fix/certification-artifact-digest-backfill
fix(plugin): backfill certified artifact digest
2026-09-26 05:23:05 +08:00
RockChinQ a5e5ee5fb8 fix(plugin): backfill certified artifact digest 2026-09-25 21:03:47 +00:00
RockChinQ 3dee5f5cf8 Merge pull request #2578 from langbot-app/feat/certified-cross-tenant-worker-pool
feat(plugin): route certified installs to shared workers
2026-09-26 03:17:25 +08:00
RockChinQ deca26a666 chore(plugin): pin SDK 0.6.3 2026-09-25 19:09:16 +00:00
RockChinQ f488087cc4 Merge remote-tracking branch 'origin/master' into feat/certified-cross-tenant-worker-pool 2026-09-25 13:33:22 +00:00
RockChinQ 300f5825bb fix(plugin): fail closed on incomplete certification records 2026-09-25 13:13:35 +00:00
Type_rBody 840214da23 Merge pull request #2577 from langbot-app/fix/certified-plugin-oss-force-install
fix(plugin): keep certified marketplace packages installable on OSS
2026-09-25 20:51:36 +08:00
RockChinQ 9f296bd57e feat(plugin): route certified installs to shared workers 2026-09-25 12:48:55 +00:00
TyperBody 4b9a1590df style(plugin): apply ruff formatting to certification.py 2026-09-25 20:37:57 +08:00
TyperBody c76fd2d7c5 fix(migration): treat an unselected runner id as not_legacy
A saved pipeline may carry the post-migration shape
{'ai': {'runner': {'id': ''}, 'runner_config': {}}} while no runner has been
selected yet. The planner matched the empty id against the certified
'plugin:author/name/component' form, failed, and returned a malformed-id
blocker, so the whole 'migrate all' batch stopped with both pipelines reported
as blocked even though there was no legacy section and nothing to convert.

A blank id with no legacy runner section now reports not_legacy: no work is
needed and no target is synthesized. A blank id that still coexists with a
legacy section remains an explicit invalid_runner_id blocker, because that
ambiguous state must be resolved by the operator rather than guessed.
2026-09-25 20:02:17 +08:00
TyperBody afe700f1d8 fix(plugin): keep certified marketplace packages installable on OSS
The certified-archive admission gate treated any declared certificate it could
not resolve as an untrusted archive and rejected the install with
CERTIFIED_PLUGIN_OSS_FORCE_REQUIRED. OSS ships an empty
plugin.certification.trusted_public_keys ring and the marketplace signs every
package with its own issuer key, so all certified marketplace packages (for
example langbot-team/RunnerDemo and langbot-team/LocalAgent) failed at the
'validating plugin package' step before artifact storage.

Admission now distinguishes an unresolvable declaration from a configured trust
decision that fails:

- record certificate_id only when the key_id is actually present in the
  configured ring, so an empty ring yields an unresolvable declaration;
- OSS degrades an unresolvable declaration to the existing oss_dev dedicated
  profile with CERTIFIED_PLUGIN_OSS_UNTRUSTED_DEDICATED instead of blocking;
- a resolvable declaration that still fails keeps requiring the explicit
  administrator force (CERTIFIED_PLUGIN_OSS_FORCE_REQUIRED);
- Cloud stays fail-closed and rejects before storage.

No shared-runtime privilege is granted when the issuer is not trusted, so this
withholds isolation rather than escalating it.
2026-09-25 19:32:54 +08:00
Type_rBody 9631eccaaf Merge pull request #2576 from langbot-app/fix/i18n-locale-sync
fix(web): align i18n locale keys and ordering with en-US
2026-09-25 18:33:27 +08:00
TyperBody 262980d612 fix(web): add missing common.next/previous pagination keys
The bot session monitor paging controls use `common.next` and
`common.previous`, but those keys never existed in any locale. They were
only rendered because of the hardcoded `defaultValue: 'Next'`/`'Previous'`.
Removing those fallbacks (previous commit) made i18next render the raw key
name, so the Playwright smoke tests could no longer find the "Next" button.

Add `common.previous` and `common.next` to all 8 locales (reusing each
language's existing `guidedTour.previous`/`next` wording) and re-align the
locale key order with the `en-US` reference.

Verified locally:
- scripts/check-i18n.mjs passes for all locales
- every t('...') key referenced by BotSessionMonitor.tsx now exists in en-US
- tests/e2e/bot-session-tool-timeline.spec.ts: 13/13 passed (including the
  two request-recovery cases that failed in CI)
- prettier / tsc / eslint clean
2026-09-25 18:07:11 +08:00
TyperBody f17b148b1a fix(web): align i18n locale keys and ordering with en-US
The bot session monitor referenced several translation keys that did not
exist in any locale file. Because i18next `fallbackLng` is `zh-Hans`, the
missing keys fell back to the hardcoded English `defaultValue`, leaking
untranslated strings (e.g. "0 sessions", "User ID or name", "Search") into
every non-English UI.

- Add the missing keys to all 8 locales with proper translations:
  `common.search`, `bots.sessionMonitor.{totalSessions,userSearch,startDate,endDate}`
  and `monitoring.toolCalls.{showDetails,hideDetails}`.
- Remove the hardcoded `defaultValue` fallbacks in `BotSessionMonitor.tsx`
  so translations are always driven by the locale files.
- Reorder nested keys in every locale file to match the `en-US.ts` reference
  order, keeping values untouched. This removes all structural drift between
  locale files (previously `guidedTour.*`, `plugins.*`, etc. were ordered
  differently).

Verified: `scripts/check-i18n.mjs` reports matching keys for all locales,
every key/value pair is preserved, Prettier passes, and `tsc --noEmit` is clean.
2026-09-25 17:05:02 +08:00
Type_rBody 043b1a2ee7 Merge pull request #2565 from langbot-app/feat/totp-two-factor-auth
feat(auth): add TOTP two-factor authentication
2026-09-25 16:18:10 +08:00
TyperBody 7543340f39 fix(web): stabilize invitation error assertions
The invitation error copy also renders as a transient sonner toast, so the
plain text locator resolved to two elements and tripped Playwright strict
mode while the toast was on screen.

Tag the inline error region with data-testid="invitation-error" and assert
against it, keeping the check deterministic under CI parallelism.
2026-09-25 15:19:34 +08:00
TyperBody 97c1addba7 Merge remote-tracking branch 'origin/master' into feat/totp-two-factor-auth
# Conflicts:
#	uv.lock
2026-09-25 14:31:03 +08:00
Type_rBody 5435b3bbfc Merge pull request #2575 from langbot-app/fix/assistant-i18n-locales
fix(web): add the assistant namespace to remaining locales
2026-09-25 14:20:03 +08:00
TyperBody 85da438d21 fix(web): add the assistant namespace to remaining locales
The workspace assistant added 39 keys under `assistant.*` to en-US,
zh-Hans and ja-JP, but es-ES, ru-RU, th-TH, vi-VN and zh-Hant were never
updated. The i18n key consistency check fails on all five, blocking the
release PR.

Add the full assistant namespace with translated copy so every locale
matches the en-US reference. No source changes; keys and placeholders
(`{{count}}`) mirror en-US exactly.
2026-09-25 14:07:50 +08:00
Type_rBody f09c8a8bed Merge pull request #2549 from langbot-app/experiment/in-process-assistant
feat(web): add an in-process workspace assistant
2026-09-25 13:56:30 +08:00
RockChinQ edd3369582 Merge pull request #2573 from langbot-app/fix/migration-certified-runner-versions
fix(migration): pin certified runner packages
2026-09-25 13:50:57 +08:00
RockChinQ eb9261fae1 fix(migration): pin certified runner packages 2026-09-25 05:42:34 +00:00
TyperBody 03f50d1afc style(web): apply prettier formatting and drop an unused import
Run prettier over the assistant files and the new dock unit test so the
web lint job passes, and remove the unused ASSISTANT_BUTTON_SIZE import
flagged by code quality review.
2026-09-25 13:38:23 +08:00
TyperBody 6283d21311 fix(web): scroll assistant to newest turn and settle the rail on release
Opening the panel left the user at the oldest message because the scroll
effect did not depend on `open`. Add it and defer the scroll to the next
frame so the popover has laid out before the sentinel is measured.

A click or an aborted swipe never arms the long press, so no drop handler
ran and a hover-expanded button stayed expanded after the pointer left.
Track real pointer presence and re-sync the rail on release.
2026-09-25 13:32:29 +08:00
TyperBody e6e1958fc5 fix(web): let the docked assistant button collapse again
`shouldCollapseRail` was keyed on `!railExpanded`, mirroring the expand
helper instead of negating it. Once a hover revealed the button it could
never collapse back into the rail, so the collapse looked broken after the
first restore.

Key the predicate on `railExpanded` being true, restore the mirror
relationship with `shouldExpandRail`, and add regression coverage for the
expand -> leave -> collapse round trip. Also lengthen the rail strip.
2026-09-25 13:22:18 +08:00
TyperBody 88257fe0e2 Merge origin/master into experiment/in-process-assistant
Resolve conflicts in the workspace assistant integration:

- DynamicFormItemComponent: keep HEAD's compact model selector and
  `disabled` field support while adopting master's `sortModelsByCatalog`
  ordering and `MODEL_SELECT_TRIGGER_CLASS`.
- i18n (en-US, ja-JP, zh-Hans): keep both the `assistant` namespace from
  HEAD and master's `sidebarGuide` / `pipelineMigration` additions.

Add 0030_merge_assistant to join the assistant conversations branch with
the released chain so the migration graph converges on a single head.
Rename it from 0030_merge_assistant_conversations to stay within the 32
character revision limit enforced by test_migrations.

Also add assistant button docking (long-press drag, edge collapse to a
short blue rail, hover restore) with pure helpers in assistant-dock.ts
and unit coverage, plus auto-collapse for finished tool result cards.
2026-09-25 13:17:44 +08:00
TyperBody f316958619 Merge remote-tracking branch 'origin/master' into experiment/in-process-assistant 2026-09-25 12:46:34 +08:00
RockChinQ 7dd943e5a0 chore(deps): pin langbot-plugin 0.6.1 (#2572)
Pin the stable SDK and refresh only its lockfile package record and artifact hashes.
2026-09-24 23:09:01 +08:00
RockChinQ 8fd8c0ed48 Merge pull request #2569 from langbot-app/fix/pin-sdk-0.6.1b2
fix(deps): pin SDK 0.6.1b2
2026-09-24 13:27:50 +08:00
RockChinQ 4e347dcbad fix(deps): pin SDK 0.6.1b2 2026-09-24 13:14:59 +08:00
RockChinQ efc2b1b981 Pin Plugin SDK 0.6.0b6
fix(deps): pin Plugin SDK 0.6.0b6
2026-09-24 04:22:01 +08:00
RockChinQ 26726da9b3 fix(deps): pin SDK 0.6.0b6 2026-09-24 04:18:15 +08:00
TyperBody 76398c8bc4 Merge origin/master into feat/totp-two-factor-auth
Resolve the revision-graph conflict introduced by the release line.

Conflicts
- tests/integration/persistence/test_rag_document_identity.py: master had
  independently introduced the same dynamic-head helper (`current_head`) plus
  a `DOCUMENT_IDENTITY_REVISION` constant, and it explicitly upgrades to that
  revision. Keep master's semantics (the explicit revision matters because
  upgrading to the head now also traverses the TOTP branch) while keeping the
  module-level alembic imports on this branch.

New migration
- 0030_merge_totp_into_release joins the TOTP branch's own merge revision
  (0026_merge_totp_and_rag_identity) with the release head
  (0029_merge_rag_identity). Both reached 0025_rag_document_identity without
  including each other, which left Alembic with two heads and made
  `upgrade head` fail with "Multiple head revisions are present".

Verification
- Single Alembic head confirmed (0030_merge_totp_into_release).
- tests/integration/persistence/test_rag_document_identity.py: 34 passed.
- Full fast integration suite: 356 passed, 84 skipped.
2026-09-24 02:27:37 +08:00
RockChinQ 105036daf9 Merge 4.11 into master
merge: integrate 4.11 into master

Co-authored-by: huanghuoguoguo <60681390+huanghuoguoguo@users.noreply.github.com>
Co-authored-by: Hyu <chenhyu@proton.me>
Co-authored-by: fdc310 <2213070223@qq.com>
Co-authored-by: WangCham <651122857@qq.com>
2026-09-24 02:11:28 +08:00
RockChinQ 3a6f4a2dce Merge 4.11 into master
merge: integrate 4.11 into master
2026-09-24 02:11:28 +08:00
RockChinQ 9b589a8f08 merge: integrate 4.11 into master 2026-09-24 02:01:00 +08:00
TyperBody 0bf610037a fix(web): keep reset-password wire shape for the default method
resetPassword() unconditionally added `method` and an empty `totp_code` to
every request, which broke the Playwright smoke test that asserts the
recovery-key flow posts exactly {user, recovery_key, new_password}.

Send only the second-factor fields that apply to the selected method, so the
default recovery-key flow stays byte-compatible with existing callers while
the totp / recovery_code methods still carry their inputs.
2026-09-24 01:31:54 +08:00
TyperBody 28e8821365 fix(auth): repair TOTP CI failures
Address the migration and formatting failures reported on the TOTP branch.

Migrations
- Register totp_credentials and totp_recovery_codes in
  _ALEMBIC_TENANT_TABLES. On a legacy PostgreSQL install these two tables
  reference users.uuid, which only exists after 0009, so create_all() must
  not run ahead of Alembic the way it did for the other tenant tables.
  Without this the PostgreSQL migration test failed with
  "column uuid referenced in foreign key constraint does not exist".

Tests
- Resolve the Alembic head dynamically in the RAG document identity
  regression instead of pinning 0025_rag_document_identity. The TOTP and
  RAG branches now meet at a merge revision, so the pinned value was no
  longer the head. This matches the convention already used by
  test_migrations_postgres.

Formatting
- Apply ruff format to the new backend modules and prettier to the locale
  files and TOTP components, so the lint jobs pass.
2026-09-24 01:31:54 +08:00
TyperBody 8633567ce7 feat(auth): add TOTP two-factor authentication
Add a per-Account time-based one-time password (TOTP) second sign-in
factor, plus the owner/admin tooling needed to operate it.

Backend
- TotpService: enrolment, constant-time verification with a +/- one step
  drift window, single-use recovery codes and disablement.
  * shared secret is only ever persisted as a Fernet token whose key is
    derived (HKDF-SHA256) from the instance JWT secret and gated by a
    key_version epoch;
  * recovery codes are only ever persisted as salted
    PBKDF2-HMAC-SHA256 digests (600k iterations) and are single-use;
  * the consumed counter advances monotonically so a captured code cannot
    be replayed inside the same time window.
- New persistence entities and alembic migrations for credentials and
  recovery codes.
- Login second-factor challenge, bound to the Account that passed the
  password step.
- Owner/admin oversight endpoints to inspect and re-bind the second
  factor of any Account.

Frontend
- Account settings panel for enrolling, managing, re-binding and
  disabling the second factor.
- Login second-factor step and the matching client methods.
- Strings for all eight locales.

The shared secret never crosses the API boundary: enrolment returns a
server-rendered QR code (as a data: URL) and the plaintext secret is
discarded as soon as the image is produced.
2026-09-24 01:31:54 +08:00
Martin 874eb6600c fix(wecombot): stop empty bubbles and premature stream close on blank final chunks (#2561)
* fix(pipeline): stop emitting empty final assistant messages

An empty final streaming chunk was appended as an empty message chain when no sandbox outbox attachment was present, so platforms received an empty reply. Only append the chain when attachments were actually collected, and gate the "Call ..." tool notice behind output.misc.track-function-calls so it no longer becomes the final chunk of a stream.

* fix(wecombot): do not close stream on a blank final snapshot

A blank final snapshot closed the WeCom stream with an empty bubble and pushed the real answer into a separate reply_text message. Skip blank final snapshots and keep the session open so the following non-blank chunk can finalize it. Covered by new regression tests.
2026-09-23 18:28:11 +08:00
RockChinQ fd940a3a06 Merge pull request #2559 from Rapeter/codex/fix-storage-analysis-menu-icon
fix(web): add storage analysis menu icon
2026-09-23 18:17:21 +08:00
RockChinQ 827626d8c5 Merge pull request #2562 from langbot-app/fix/411-debug-prompt
fix(agent): preserve configured prompts in debug runs (certified-Runner acceptance follow-up)
2026-09-23 14:27:49 +08:00