Skip to content

fix(bridge): refresh database references after setup rebind - #2365

Closed
fengzengfly wants to merge 28 commits into
TencentCloud:mainfrom
fengzengfly:fix/bridge-manager-db-rebind
Closed

fengzengfly wants to merge 28 commits into
TencentCloud:mainfrom
fengzengfly:fix/bridge-manager-db-rebind

Conversation

@fengzengfly

Copy link
Copy Markdown

Summary

Fix /api/bridge/connections returning HTTP 500 after the setup wizard rebinds an already initialized database.

During rebind, the old connection pool is closed and runtime services are updated. However, BridgeManager retained repositories backed by the old pool, causing Bridge requests to fail with psycopg_pool.PoolClosed while user creation and other APIs continued to work. This can also happen when setup reapplies the same PostgreSQL configuration.

  • Retarget Bridge connection, secret, and user repositories during runtime service replacement.
  • Resolve the current services when signing Bridge user tokens instead of retaining the previous services.
  • Add regression coverage for querying Bridge connections after closing the old pool, and for Bridge access and token signing after setup rebind.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

Verified locally:

  • uv run pytest tests/integration/test_setup_database.py tests/unit/db/test_runtime_replace_services.py -q — 7 passed.
  • uv run ruff check src/octop/infra/bridge/manager.py src/octop/infra/server.py tests/integration/test_setup_database.py tests/unit/db/test_runtime_replace_services.py — passed.
  • uv run ruff format --check src/octop/infra/bridge/manager.py src/octop/infra/server.py tests/integration/test_setup_database.py tests/unit/db/test_runtime_replace_services.py — passed.
  • uv run mypy src/octop — passed, no issues in 609 source files.

The full make all suite has not been run. Regression tests use SQLite to reproduce the stale-pool lifecycle; PostgreSQL-specific validation has not been run locally.

  • make all passes locally
  • Added/updated tests

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

github-actions Bot and others added 28 commits October 18, 2026 15:10
…elop-after-1.0.2

chore: sync main into develop after 1.0.2
…y fallback (TencentCloud#2171) (TencentCloud#2174)

* fix(infra): relocate wizard password file under OCTOP_HOME with legacy fallback

Derive the wizard password location from PathLayout root (OCTOP_HOME)
instead of hardcoding Path.home(). When OCTOP_HOME is relocated, the
password file is created and resolved from <OCTOP_HOME>/octop-login.txt.

To preserve complete backward compatibility for existing installations,
resolve_password_path, ensure_password, and read_password maintain a
fallback to legacy ~/octop-login.txt, migrating and synchronizing the
secret on boot when upgrading so no duplicate secrets are generated.

Closes TencentCloud#2171

* docs(changelog): record octop-login.txt OCTOP_HOME relocation fix (TencentCloud#2171)
…ch is off (TencentCloud#2105)

The image/video model Form.Items unmount when "启用生图工具"/"启用生视频工具"
is switched off, and an unmounted field is not part of what
Form.validateFields() returns. providerFromForm() then read
values.image_model.trim() on undefined, the TypeError was swallowed by the
surrounding catch, and every button in the modal (保存, 验证凭证, 测试模型)
became a silent no-op.

Read the model fields back from the whole form store (which keeps the
preserved value of an unmounted field) and normalize every string field
defensively, so a disabled tool keeps the model it was configured with
instead of collapsing to an empty string.

Fixes TencentCloud#2100

Co-authored-by: Jay0130-a <Jay0130-a@users.noreply.github.com>
…centCloud#2044)

Co-authored-by: chqcjq <3361008+chqcjq@users.noreply.github.com>
…encentCloud#1657)

The remote dashboard origin never loads Wails runtime.js, so the official
edge-resize logic never runs; the injected overlay only covered dragging
and double-click maximise. Extend it with the runtime's own strategy:
pure window-event edge detection (5px edges, 12px corners, scrollbar
width excluded), invoking wails:resize:<cursor> - the exact message
HandleMessage in wails v3.0.0-beta.13 dispatches to startResize. Presses
on a resize edge no longer arm title-bar dragging. No overlay elements
are created.

Closes TencentCloud#1656

Co-authored-by: Jay Feng <jayfeng77@outlook.com>
…tter (TencentCloud#2226)

* feat(skills): shared packages, file tree editor, and BOM-safe frontmatter

Add skill-package sharing (private by default), package skill file-tree APIs
aligned with personalization, and strip UTF-8 BOM when parsing SKILL.md.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(tests): bump backup schema assertions to v22

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: leoxyang <leoxyang@tencent.com>
Co-authored-by: leoxyang <leoxyang@tencent.com>
…ncentCloud#2248)

Middleware returned raw English diagnostics because it bypassed the
global OctopError handler. Resolve the request locale and pass it to
to_envelope, matching bridge_proxy and the app handlers (TencentCloud#2187).
…ss (TencentCloud#2222)

* fix(chat): refuse to delete a conversation while a reply is in progress

Deleting the thread mid-turn dropped the row while history was still
being written, and the foreign-key failure showed up as a model-call
error. Return 409 until the turn is idle and leave the confirm dialog open.

* docs: add redacted screenshots for the in-progress delete refusal

The PR images only show the warning and the success toast, without the
session list or account.

---------

Co-authored-by: Jubaoliang <jubaoliang@gmail.com>
…Cloud#2229)

Random gaps that missed the care window were pinned to the opening two hours, and a push could land in the middle of a conversation. Wait for an idle chat inside care hours, including windows that cross midnight, and drop the message if the user starts talking while it is being written.

Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(users): limit resource visibility by user group

Admins can create groups and assign members. Skill packages, knowledge
bases, connectors, models, and named storage backends can then be
restricted to those groups without granting extra edit rights.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(users): gate connector and storage use by group and show the catalog

Replace per-instance connector and storage grants with one feature-level control, list every resource kind on the group page, and make skill-package sharing follow a single audience choice.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…ncentCloud#2275)

Expose yuanbao_search in tool settings and let the search page store and probe TENCENTCLOUD_WSA_APIKEY the same way as the other keyed providers.
…wers (TencentCloud#2285)

* feat(dashboard): shared resource avatar picker across create/edit drawers

Extract ResourceAvatarPicker for experts, teams, skill packages, knowledge
bases, and bridge connections, with upload APIs and schema fold-in for
icon_url. Add team cartoon presets and local/cloud filters on My Experts
and My Teams.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(users): add bridge cloud-collab to the permission catalog

Expose 云端协同 in user/role permission pickers, gate the sidebar and
API behind it, and grant existing accounts once so prior open access is
preserved.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(dashboard): rename built-in experts tab and drop Beta badges

Use “内置专家模板” for the library tab, and remove Beta labels from
My Teams and the cloud-collab nav item.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…-ime-keyboard

fix(browser): restore IME input and editing keys
…entCloud#2295)

* fix: encrypt secrets at rest, subpath deploy, decision tool defaults

Unify Fernet helpers under infra/crypto and seal storage/provider/voice
keys plus decision/Langfuse secrets, with plaintext read fallback.
Support VITE_BASE_PATH for reverse-proxy subpaths, and default decision
tool filtering off so capability tools are not silently dropped.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: expose sealed repo _db for runtime rebind checks

SealedProviderRepo wraps the SQL repo; tests and setup rebind assertions
still probe ._db for pool identity.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: unify AI text assist for forms and chat polish

Add POST /api/text/assist with backend i18n prompts, wire P0 create/edit
fields, migrate chat polish onto the same path, and polish expert picker UX.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(tests): rename text_assist test module to avoid basename clash

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…Cloud#2307)

Share a ResourceVisibilityFields control across connectors, bridge, plugins,
storage, KB, and skill packages; validate visibility before shared writes;
add skill AI polish with zh/en presentation tabs and tighten form spacing.

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Changed the platform designation in the native manifest from 'all' to 'x86' for clarity on architecture support. Updated README to reflect this change and provide additional context regarding ARM package builds.
…lists (TencentCloud#2320)

Experts use the same audience rules as other resources, cards mark who shared them, and list filters show only what others shared with you. Host control moves under infra/control, text assist calls a host model factory, and providers can be marked for embeddings.

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rentiate-arch

fix(fnos): stamp native packages as x86 or arm
…encentCloud#2168)

Cloud bridge connection cards are the usual screen-share surface, so the
peer address and account now render masked by default:

- address: keep the scheme/port plus the first and last two characters of
  the host; IPv4 keeps the first and last octet (middle two masked)
- account: keep the first and last two characters; accounts shorter than
  six characters keep only the first character
- fixed-width dots, so the masked length does not leak the real length

A master switch in the panel toolbar (on by default, persisted in
localStorage) controls the whole page, and each card/table row can be
revealed temporarily. Reveals are session-only and reset on reload or
when the master switch flips. The edit drawer keeps plaintext values,
since that is where connection data is edited.

Display only: no API, storage or tooltip changes.
…oud#2261)

Delete-only was rebuilding the SQLite file as soon as the expert was idle. That request now only removes the rows and leaves reclaim to idle maintenance.

Co-authored-by: Cursor <cursoragent@cursor.com>
TencentCloud#2338)

Give every bundled template six welcome cards, group the library by the same scenes as the expert market, and keep create/edit section headers aligned with the form. The default sample avatar now uses the same portrait style as the other presets.

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…Cloud#2340)

hub.subscribe ran after prepare_dashboard_turn/_maybe_admit_steer —
both awaited — and was skipped entirely when a frame was handled as a
steer. WebSocketHub.push_to_thread drops frames for threads with no
subscribers, so under load (or on a reconnecting client whose steer is
the first user_turn) steer.queued/steer.rejected/steer.discarded and
any concurrently running turn's tail chunks were silently lost.

Subscribe immediately after prepare_dashboard_turn resolves and
validates the thread, before any further await.
@jubaoliang

Copy link
Copy Markdown
Collaborator

请把这个变更重新提交到 develop。功能修改和问题修复都要指向 develop,不要直接指向 main。

Please open this change against develop instead of main.

@jubaoliang jubaoliang closed this Oct 31, 2026
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.