Commit Graph
136 Commits
Author SHA1 Message Date
RockChinQ 7fa9c0e426 fix: 修复独立环境登录 404 与「添加第一个模型」500(4.11 回归) (#2755)
* fix(space): keep dedicated-environment Space login working

A dedicated environment runs the OSS runtime with system.edition=cloud. The
process-level 'LangBot Models' compatibility provider is part of the OSS
single-Workspace contract, but write_space_model_providers() skipped creating it
for every non-community edition. The Space OAuth callback then unconditionally
rewarded the provider row by api key, so provider_service raised
WorkspaceNotFoundError('Provider not found') and the whole callback returned 404
-- after the Account and its Workspace had already been created. Every retry
failed the same way, making dedicated-environment login impossible on 4.11.x.

Gate the compatibility provider on the deployment shape instead of the edition
(genuine multi-tenant Cloud runs in CLOUD_RUNTIME persistence and never reaches
this path), and treat a missing provider row as a model-routing warning rather
than an authentication failure so a data anomaly can never block login.

* fix(agent): bind the first model to the 4.11 runner config

create_llm_model() still wrote the auto-selected model into the pre-4.11
ai['local-agent'] container. On a 4.11 Workspace that key does not exist, so the
assignment raised KeyError and POST /provider/models/llm returned 500 the first
time a user added a model -- and the default pipeline kept primary='', so every
Agent run failed with 'No authorized model for local-agent'.

Delegate to RunnerDefaultConfigService, which resolves the selected runner and
writes the schema-defined model selector into ai.runner_config[<runner id>].

Also default the NOT NULL description column on pipeline and bot creation:
omitting an optional description returned a 500 from the constraint instead of
creating the resource.

* fix(agent): keep seeding the model for pipelines that never migrated

set_pipeline_llm_model_if_empty() returns False when a pipeline has no 4.11
runner selected -- that is exactly the un-migrated shape, which still carries
ai.local-agent. Seed that container, but only when it exists, so the legacy path
keeps its old behaviour without the KeyError.
2026-10-22 23:26:30 +08:00
RockChinQandmultica-agent 0b341086fb LANG-145: enforce credential-session TTL on a timer, not on traffic (#2756)
* fix(platform): enforce credential-session TTL on a timer, not on traffic

The four adapter registration flows (Lark one-click app, DingTalk device flow,
WeCom bot, QQ Official bind) each park a short-lived secret in an in-memory
session dict until the caller persists it: app_secret, client_secret, or the bot
secret.

Each store had a TTL and a cleanup function, but the cleanup only ran at the top
of a route handler. An abandoned flow therefore kept its secret in memory until
some *other* request happened to arrive, which for a quiet instance can be far
past the validity window (15 min for Lark, 10 for DingTalk, 5 for WeCom/QQ).

Changes:
- Move the sweep to module level as _sweep_credential_sessions(stores) so it is
  directly testable, and have it scrub app_secret/client_secret/secret as it
  evicts, so an evicted session dict no longer retains a readable credential.
- Add a background sweeper task started from the router group's initialize(),
  running every 60s, so the TTL holds regardless of traffic.
- Keep the per-route cleanups: they make eviction immediate under load.

Tests: 9 new cases (expiry, fresh sessions survive, secret scrubbing, per-store
TTL, cancelling a pending handshake task, not cancelling a finished one,
malformed session without created_at, multiple evictions, empty stores).

Co-authored-by: multica-agent <[email protected]>

* fix(platform): tolerate a task manager without create_task when starting the sweeper

The sweeper is started from the adapter router group's initialize(). Some
embeddings of the app provide a task manager that only exposes create_user_task,
so an unconditional create_task broke those harnesses. Fall back to the per-route
cleanups when create_task is unavailable.

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: multica-agent <[email protected]>
2026-10-22 21:51:01 +08:00
RockChinQandmultica-agent 01789e498a LANG-145: bind WebAuthn to server config and make passkeys OSS-only (#2744)
* LANG-145: bind WebAuthn to server config and make passkeys OSS-only

Two problems in the passkey implementation:

1. The RP ID and expected origin came from the request: a JSON 'origin' field,
   then the Origin/Referer headers, then the request URL. WebAuthn's
   anti-phishing guarantee depends on values the server chose; trusting the
   request lets a sibling host under the same registrable domain obtain a valid
   assertion for a victim's credential. Resolution now follows the same rule the
   OAuth and invitation links already use: api.webui_url, then
   api.webhook_prefix, then the configured port on loopback.

2. Passkeys are now an OSS-only feature. Cloud deployments authenticate through
   their own account service, so every passkey route (register options/verify,
   auth options/verify, list, rename, delete) refuses with
   edition_unsupported, and /account-info advertises neither passkey_login_enabled
   nor passkey_supported. Both cloud flavours are covered: system.edition ==
   'cloud' and deployment.mode == 'cloud'.

Tests:
- New unit suite for the edition matrix and for origin resolution (including
  that client-supplied origin/Origin/Referer are ignored).
- The three 'reverse proxy scenario' tests asserted the old, unsafe behaviour
  (server trusting the request). They now assert the server-config contract.
- test_smoke cloud capabilities expectation updated to passkey_* = false.

Co-authored-by: multica-agent <[email protected]>

* style(api): drop the typing import left unused by the WebAuthn origin change

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: multica-agent <[email protected]>
2026-10-22 20:39:21 +08:00
RockChinQandmultica-agent d13ae56ea5 fix: bot routing setup and busy-session response checks (#2728)
Apply group response rules before busy-session steering. Initialize usable private-message and group-mention routes for new bots, including Wizard-created pipelines, and preserve member-configured rules across saves and retries.

Fix empty pipeline configuration, refresh the processor sidebar after automatic creation, and show creation feedback. Align routing regressions and use Node 24 for the browser CI job.

Correct the task's erroneous agent attribution while preserving every code tree and the original human contribution.

Co-authored-by: multica-agent <[email protected]>
2026-10-20 21:22:53 +08:00
Chin Rock 40d40204cf fix(install-diagnostics): Sanitize plugin installation network diagnostics (LANG-132) 2026-10-20 07:53:56 +00:00
彼方 1baba1b9f9 Merge pull request #2725 from langbot-app/fix/session-summary-persistence
fix(monitoring): persist session summaries to avoid history scans
2026-10-20 11:53:06 +08:00
BiFangKNT 3b1ea56f4f fix(monitoring): avoid historical payload reads in execution filters
- Add covering indexes through migration 0040
- Preserve PostgreSQL FORCE RLS state when marking historical summaries
- Add query-plan and migration regression tests to CI
2026-10-20 10:45:44 +08:00
BiFangKNT 7129e20cf6 fix(monitoring): paginate conversation IDs before loading message payloads
Count and paginate lightweight records, then load payloads only for the
selected page to avoid materializing large historical messages.

Add regression coverage for oversized history, ingress deduplication,
stable pagination, and PostgreSQL tenant isolation.
2026-10-20 09:34:05 +08:00
BiFangKNT 810d053df9 fix(monitoring): persist session summaries to avoid history scans
- Maintain counts and display snapshots in source transactions with replay-safe deduplication.
- Read session lists exclusively from summaries and remove execution-only filters.
- Automatically initialize historical summaries in bounded, resumable batches during OSS startup.
- Add behavioral contracts covering accounting, retention, query cost and PostgreSQL concurrency.

Verified with the required session_summary suite and real container upgrade startup.
2026-10-20 06:12:00 +08:00
RockChinQandmultica-agent d9e4e7d9df fix(pipeline): decouple Runner from extension permissions (LANG-54) (#2723)
* fix(pipeline): decouple runner from extension allowlist

Co-authored-by: multica-agent <[email protected]>

* fix(pipeline): complete runner diagnostics and real runtime coverage

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: multica-agent <[email protected]>
2026-10-19 23:07:11 +08:00
BiFangKNT 57077740bd chore(merge): sync master and preserve monitoring test coverage 2026-10-18 12:43:44 +08:00
BiFangKNT d610d64c67 fix(storage): expire historical inline images with bounded TTL cleanup
- Apply media retention to inline images while preserving text and URLs
- Persist per-workspace cursors atomically with payload updates
- Bound candidate scans and verify event ownership before loading payloads
- Add cleanup indexes and regression tests, and fix Windows path assertions
2026-10-18 09:58:04 +08:00
huanghuoguoguo 13b8edeace Merge pull request #2705 from langbot-app/test/required-contract-suites
test(ci): decouple required suites from test names and counts
2026-10-17 23:12:59 +08:00
BiFangKNT f12490bc73 perf(monitoring): load execution details on demand
- Load overview first and fetch secondary sections when expanded
- Add a covering index and select conversation IDs before loading page payloads
- Preserve full-detail API compatibility and add pagination and lazy-loading tests
2026-10-17 21:10:55 +08:00
huanghuoguoguo 8dfdb4fc45 test: preserve session and quota contracts when merging master 2026-10-17 20:14:10 +08:00
huanghuoguoguo f30abc7bce Merge pull request #2690 from langbot-app/test/quality-unit-api-maintenance-20261017
test: verify scoped cleanup and storage analysis contracts
2026-10-17 20:12:01 +08:00
huanghuoguoguo 916b4a4b14 Merge pull request #2689 from langbot-app/test/quality-unit-api-identity-20261017
test: verify identity persistence and credential boundaries
2026-10-17 20:11:54 +08:00
huanghuoguoguo 849ad84810 Merge pull request #2688 from langbot-app/test/quality-unit-api-orchestration-20261017
test: verify bot and pipeline persistence and isolation
2026-10-17 20:11:48 +08:00
huanghuoguoguo 4a84ccffe6 Merge pull request #2685 from langbot-app/test/quality-unit-api-extensions-20261017
test: enforce MCP and webhook persistence and lifecycle contracts
2026-10-17 20:11:30 +08:00
huanghuoguoguo 3a508b5bda Merge pull request #2683 from langbot-app/test/quality-unit-api-providers-20261017
test: strengthen provider service and secret response contracts
2026-10-17 20:11:18 +08:00
huanghuoguoguo 0c71bba2f0 Merge pull request #2682 from langbot-app/test/quality-unit-api-models-20261017
test(api): verify model persistence and runtime boundaries
2026-10-17 20:11:12 +08:00
BiFangKNT 4d90358da0 perf(monitoring): exclude payloads from session summaries
Exclude message_content and variables from the message source used by
conversation session summaries. These fields were carried through window
sorting even though the resulting summaries did not use them.

Preserve complete payloads for message detail queries. Add regression
coverage for summary counts, session metadata, and full message retrieval.
2026-10-17 19:46:39 +08:00
BiFangKNT d663331889 fix(monitoring): bound inflight snapshot queries
Require a valid owner and unexpired lease for pending Pipeline messages
to appear as active tasks. Exclude historical ingress records without
rewriting their stored status.

Project only the fields needed by snapshots, skip linkage queries for empty
results, and resolve linked runs from selected message IDs instead of a
cross-table OR join that scans historical messages.

Cover lease filtering, terminal transitions, Workspace isolation, payload
exclusion, and indexed lookup plans with regression tests.
2026-10-17 19:45:19 +08:00
huanghuoguoguo 837fa1d4fc test(web): verify session pagination and workspace quota contracts 2026-10-17 16:31:20 +08:00
huanghuoguoguo 5ad95e100e test(api): verify maintenance outcomes and upload context 2026-10-17 15:44:19 +08:00
huanghuoguoguo bac69e987a test(api): verify identity predicates and credential side effects 2026-10-17 15:43:50 +08:00
huanghuoguoguo 1adc2a6046 test(api): verify orchestration writes and scoped state transitions 2026-10-17 15:43:38 +08:00
huanghuoguoguo d5bc009426 test(api): verify extension persistence and connection task behavior 2026-10-17 15:42:54 +08:00
huanghuoguoguo ca997e6faa test(api): verify provider persistence and returned service payloads 2026-10-17 15:29:54 +08:00
huanghuoguoguo 69a415e562 test(models): verify model persistence and runtime boundaries 2026-10-17 15:26:38 +08:00
huanghuoguoguo 4afd86c1f6 test: consolidate duplicate backend contracts and strengthen stage checks 2026-10-17 15:03:50 +08:00
huanghuoguoguo 5641637d3d Merge pull request #2665 from langbot-app/test/regression-boundary-cleanup-20261017
test: remove self-confirming tests and strengthen regression boundaries
2026-10-17 11:26:46 +08:00
huanghuoguoguo 3f2d52e557 Merge pull request #2512 from langbot-app/feat/2410-sdk-skill-store
feat(skill): decouple read-only skills from Box execution
2026-10-17 10:13:26 +08:00
huanghuoguoguo d54e533985 fix(skill): pin revisions per run and preserve shared Box state 2026-10-17 09:32:41 +08:00
huanghuoguoguo 2b79b04d36 Merge pull request #2635 from langbot-app/test/core-contract-coverage-gaps
test(core): verify runtime behavior and close PostgreSQL coverage gaps
2026-10-17 09:13:07 +08:00
RockChinQ 338b856eec fix(monitoring): restore Cloud in-flight snapshots and collapsed dock 2026-10-15 16:42:24 +08:00
RockChinQ 68a3f64cef test(core): update bot fixtures for platform policy checks 2026-10-15 05:31:04 +00:00
RockChinQ 14b5bdb8c2 feat(cloud): enforce plan policies and refine workspace interface 2026-10-15 05:31:04 +00:00
Hyu e29fd27f02 feat(i18n): localize backend messages by workspace language 2026-10-15 05:31:04 +00:00
HyuandClaude Opus 5.5 c0cfb5c18c feat(pipeline-migration): relax legacy config migration and pin latest runner plugins
- Coerce/default/drop invalid or unknown legacy fields with warnings instead of blocking
- Never block on LocalAgent model; prune dangling KB/tool/MCP references
- Mark custom (non-builtin) 4.10 runners as unsupported_runner instead of failing
- Pin runner plugins to current marketplace versions (0.2.x); fall back to latest when a pin is withdrawn
- Raise plugin install/upgrade timeout to 600s for slow dependency installs
- Assistant configure_pipeline writes the 4.11 runner shape

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 00:09:52 +08:00
Hyu 417c552694 fix(web): correct monitoring empty states and Space request headers 2026-10-12 13:36:26 +08:00
RockChinQ 4bcf6e6894 test: align inactive bot log expectation with empty result 2026-10-11 16:35:57 +00:00
RockChinQ 80ea528ca0 fix: wizard preview TLS, progress storage and inactive bot logs (#2651) 2026-10-12 00:15:58 +08:00
RockChinQ 13446ecfd3 fix: scope inflight snapshots and compact mobile dashboard (#2650) 2026-10-11 23:08:31 +08:00
Hyu 33ea03701a test: update adapter and monitoring regression fixtures 2026-10-11 01:10:40 +08:00
Hyu 3ff849d243 test: align processor fixtures with current creation and startup behavior 2026-10-11 01:03:31 +08:00
Hyu 4a700ac0f3 feat(slack): add guided app setup and Socket Mode support 2026-10-10 23:37:30 +08:00
Hyu 1c70218383 feat: reset bot session context while retaining monitoring history 2026-10-10 22:35:27 +08:00
Hyu 38aa06e149 feat(monitoring): add shared SSE in-flight monitor with draggable dock 2026-10-10 21:30:03 +08:00
RockChinQ f96f663a80 feat(assistant): add streaming background sessions and refresh workspace UI 2026-10-08 13:24:46 +08:00