Commit Graph

3730 Commits

Author SHA1 Message Date
huanghuoguoguo 2f9bfb1248 fix(skills): add restore_activated_skills_from_state function
The function was accidentally removed during conflict resolution with master.
Also add ACTIVATED_SKILL_NAMES_STATE_KEY constant.
2026-06-19 10:52:39 +08:00
huanghuoguoguo 03ad58ec4d merge: resolve conflicts with master, add inbound attachment materialization
- Delete localagent.py and test_difysvapi_runner.py (replaced by plugins)
- Keep master's tool loader enhancements (byte_offset, encoding params)
- Remove feature branch's artifact reference code (use sandbox paths instead)
- Add _materialize_inbound_attachments in orchestrator for sandbox file staging
- Keep master's test formatting and new tests
- Keep master's frontend refactoring
2026-06-19 10:51:00 +08:00
huanghuoguoguo 79a5fba06b refactor(agent-runner): use sandbox file model 2026-06-19 10:24:49 +08:00
huanghuoguoguo a020ca680f Harden agent runner tool runtimes (#2247)
* fix(tools): harden agent runner tool runtimes

* fix(tools): bootstrap Python workspaces with available interpreter

* fix(tools): clear stale Python workspace env locks

* fix(tools): decouple runtime from agent runner

* test(tools): cover runtime hardening edge cases

* fix(tools): support binary workspace file chunks
2026-06-18 14:06:04 +00:00
huanghuoguoguo 3a2edf9753 fix(survey): prevent option controls from submitting forms (#2249) 2026-06-18 22:01:10 +08:00
huanghuoguoguo 5fe63ce822 Bound Space model sync startup wait (#2248)
* fix(modelmgr): bound Space model sync startup wait

* style(provider): format model manager
2026-06-18 22:00:33 +08:00
Junyan Chin 6b15a732e4 fix(box): purge leftover inbox/outbox on startup; clear root-owned outbox via exec (#2259)
The agent attachment outbox is written by the sandbox container as root over
the bind-mount, so the LangBot host process (non-root) cannot rmtree those
files — the host-side delete failed silently and stale files were re-collected
on a later turn that reused the same query_id (the query_id counter resets to 0
on every restart).

- BoxService.initialize now purges leftover inbox/outbox after the runtime is
  available: host rmtree first, then an in-sandbox 'rm -rf' via exec for any
  root-owned survivors.
- _clear_outbox now falls back to exec when the host delete leaves root-owned
  files behind, instead of silently failing.
- collect_outbound_attachments clears the outbox unconditionally (even on an
  empty collection) so a reused query_id never inherits stale files.
- Tests: startup purge (host-owned + root-owned exec fallback + no-workspace
  noop) and empty-collection-still-clears.
2026-06-18 21:59:48 +08:00
Junyan Chin a1e6eccdeb feat(box): bidirectional attachment transfer for sandbox (#2257)
* feat(box): bidirectional attachment transfer for sandbox

Materialize inbound attachments into the sandbox workspace so agents can
process user-sent files, and collect agent-produced files from the outbox
to attach them back to the reply.

- box(service): add materialize_inbound_attachments / collect_outbound
  attachments. Prefer direct host-filesystem read/write on the bind-mounted
  workspace (no size limit), falling back to chunked exec only for
  non-shared backends (e2b/remote). Clear per-query inbox/outbox dirs at
  turn start to avoid query_id-reuse collisions.
- provider(localagent): inject inbound attachment descriptors into the
  sandbox and append a system note telling the agent the inbox/outbox paths.
- pipeline(wrapper): collect outbox files on the final stream chunk and
  append them as attachment components to the response chain.
- web(debug-dialog): render File components with a download link when
  base64/url is present; add base64/path fields to the File entity.
- tests: cover inbound/outbound, large-file transfer without truncation,
  and stale-dir clearing (86 passing).

* feat(box): support voice/file attachment round-trip end-to-end

Extends the bidirectional attachment transfer to audio and arbitrary files
through the real webchat UI, and fixes the model-payload errors that
non-image attachments triggered.

- platform(websocket_adapter): resolve Voice/File component storage keys to
  base64 (previously only Image), so audio/documents reach the sandbox inbox.
- web(debug-dialog): accept audio/* and any file in the uploader (was
  image-only), classify by mimetype, upload Voice/File via the documents
  endpoint, and render non-image staged attachments as a chip.
- provider(litellmchat): drop non-image file parts (file_base64 / file_url)
  when building the OpenAI/LiteLLM payload. These come from Voice/File
  attachments — including ones replayed from conversation history — and the
  agent reads their bytes from the sandbox, not the model. Without this the
  provider rejects the request: 'invalid content type=file_base64'.
- provider(localagent): also strip those parts from the current user message
  alongside the sandbox-path note (model-facing clarity; the requester is the
  real safety net for history).
- tests: cover the requester strip/keep behavior (file dropped, image kept and
  reshaped to image_url, mixed history, plain-string content).

* test(box): cover inbound/outbound attachment helpers; fix ruff format

- ruff format localagent.py (CI ruff format --check was failing)
- add unit tests for ResponseWrapper outbound-attachment helpers (wrapper.py 78%->98%)
- add unit tests for LocalAgentRunner._inject_inbound_attachments
- add unit tests for WebSocketAdapter._process_image_components (0%->covered)

Lifts PR patch coverage from 68.97% to ~88% (>75% target).
2026-06-18 21:40:31 +08:00
huanghuoguoguo 2c09af406e feat(agent-runner): expose stats for control plane 2026-06-16 23:29:04 +08:00
huanghuoguoguo b3c6de2072 [codex] cover frontend CRUD smoke flows (#2253)
* test: cover frontend CRUD smoke flows

* test: add bot CRUD smoke coverage

* test: add bot/pipeline advanced flows and cross-resource tests

- Bot enable/disable toggle with state persistence
- Bot detail tab switching (Configuration, Logs, Sessions)
- Bot form dirty state and save button behavior
- Bot name validation error display
- Pipeline tab switching (Configuration, Dashboard)
- Pipeline form dirty state
- Pipeline name validation error display
- Cross-resource flow: create pipeline then bind to bot
- Empty states for bots, pipelines, knowledge bases, MCP servers
2026-06-16 21:34:17 +08:00
RockChinQ 4e45886647 style(web): show Models above API Integration in main sidebar footer 2026-06-16 06:04:59 -04:00
RockChinQ f592656680 refactor(web): unify settings panel layouts with shared toolbar/body
- Add PanelToolbar/PanelBody primitives so all four settings tabs share
  the same top-toolbar + scrollable-body rhythm under the unified header.
- API panel: drop the heavy gray shadowed TabsList; move the create
  action into the toolbar next to the tabs, lighten per-tab hints.
- Storage panel: reuse PanelToolbar for the generated-at/refresh bar.
- Account panel: wrap content in PanelBody for consistent padding.
- Models panel: keep the pinned LangBot Models (Space) card at the very
  top, above the add-custom-provider row (intentional pin), using
  PanelBody instead of a top toolbar.
2026-06-16 06:02:20 -04:00
RockChinQ e9db858dcc feat(web): unified header for settings dialog, shorter sidebar labels
- Add a shared section header (icon + title + description) with right
  padding so the dialog close X no longer overlaps panel content, and
  every tab now shares the same top layout for a consistent look.
- Shorten inner sidebar nav labels (Models/API/Storage/Account) via new
  settingsDialog.nav.* i18n keys across all 8 locales.
- Add common.apiIntegrationDescription and account.settingsDescription
  for the new header.
2026-06-16 05:50:44 -04:00
RockChinQ 2d6faf9d5e refactor(web): drop legacy ModelsDialog, use unified SettingsDialog everywhere
The model-selector in dynamic forms (pipeline / knowledge base settings)
still opened the old standalone ModelsDialog. Point it at the unified
SettingsDialog (section pinned to models) and delete the now-unused
ModelsDialog wrapper so only the new dialog remains.
2026-06-16 05:41:58 -04:00
RockChinQ d4699547e9 i18n(web): localize Bots/Pipelines sidebar titles for es/th/vi
es-ES pipelines, th-TH bots+pipelines and vi-VN pipelines were left in
English in the sidebar. Translate them: es Flujos, th บอท/ไปป์ไลน์,
vi Quy trình.
2026-06-16 05:27:10 -04:00
RockChinQ 716d7aca94 fix(web): fixed-height settings dialog, narrower sidebar
Pin the dialog to a fixed 80vh (cap 800px) so switching sections no
longer resizes it; panels scroll their own content internally. Override
the SidebarProvider wrapper's default h-svh with h-full so both columns
fill the dialog height. Narrow the inner settings sidebar to w-44.
2026-06-16 05:22:42 -04:00
RockChinQ b3c00fe6da fix(web): use fixed height for settings dialog instead of 80vh
Avoid the dialog stretching to fill tall viewports (large empty space).
Pin to 620px with max-h-[85vh] fallback and narrow width to 52rem.
2026-06-16 05:18:14 -04:00
RockChinQ f4a6edf7ec refactor(web): unify settings dialogs into single dialog with sidebar
Merge API integration, model settings, account settings and storage
analysis into one SettingsDialog with a shadcn inner sidebar for
section switching. Preserve existing ?action= query-param deep links
(showModelSettings / showAccountSettings / showApiIntegrationSettings /
showStorageAnalysis) by mapping each to a section. Extract reusable
panels and keep ModelsDialog as a thin wrapper for the dynamic-form
model picker.
2026-06-16 05:06:06 -04:00
huanghuoguoguo 033820e0bc docs(agent-runner): update v2 foundation status 2026-06-16 11:24:20 +08:00
huanghuoguoguo f390980d0a test: format test suite (#2252) 2026-06-16 11:22:29 +08:00
huanghuoguoguo e1e5be553a docs(agent-runner): update security boundary status 2026-06-16 11:12:05 +08:00
huanghuoguoguo 1ae5aacc00 test: add frontend smoke and backend e2e CI (#2251) 2026-06-16 11:09:55 +08:00
huanghuoguoguo cfaaf62c3d fix(plugin-pages): wait for page metadata before iframe load 2026-06-15 21:38:50 +08:00
huanghuoguoguo e9dd7f423d feat(agent-runner): add admin reconcile primitives 2026-06-15 19:42:33 +08:00
huanghuoguoguo aa4fdd1144 feat(agent-runner): add host admin permissions 2026-06-15 18:55:11 +08:00
huanghuoguoguo 9aa643b55f feat(agent-runner): add host run ledger primitives 2026-06-15 18:09:05 +08:00
huanghuoguoguo d073134c83 chore(agent-runner): align marketplace download indentation 2026-06-14 21:36:44 +08:00
huanghuoguoguo 50c68e658c chore(agent-runner): restore base marketplace formatting 2026-06-14 21:35:55 +08:00
huanghuoguoguo d04a8dba29 chore(agent-runner): keep base package dependency inspection 2026-06-14 21:34:59 +08:00
huanghuoguoguo ad61b9fddc chore(agent-runner): remove split marketplace metadata residue 2026-06-14 21:34:02 +08:00
huanghuoguoguo 759f427110 chore(agent-runner): align split runtime files with base 2026-06-14 21:26:21 +08:00
huanghuoguoguo 4205858957 chore(agent-runner): merge split tool runtime base
# Conflicts:
#	src/langbot/pkg/box/workspace.py
#	src/langbot/pkg/provider/tools/loaders/mcp_stdio.py
#	src/langbot/pkg/provider/tools/loaders/native.py
#	src/langbot/pkg/provider/tools/loaders/skill.py
#	tests/unit_tests/box/test_workspace.py
#	tests/unit_tests/provider/test_mcp_box_integration.py
2026-06-14 21:22:05 +08:00
huanghuoguoguo 0a71747eec chore(agent-runner): remove split-out incidental fixes 2026-06-14 21:20:31 +08:00
huanghuoguoguo 9fa3251f3d fix(tools): decouple runtime from agent runner 2026-06-14 21:15:21 +08:00
huanghuoguoguo 64b7e9c509 fix(tools): clear stale Python workspace env locks 2026-06-14 11:32:10 +08:00
huanghuoguoguo 7b67dcc302 fix(tools): bootstrap Python workspaces with available interpreter 2026-06-14 11:32:10 +08:00
huanghuoguoguo a60827f221 fix(tools): harden agent runner tool runtimes 2026-06-14 11:32:10 +08:00
huanghuoguoguo e9fe2f2d43 feat(agent-runner): support host tool lookup (#2244) 2026-06-14 11:29:57 +08:00
huanghuoguoguo 9037d7f592 chore(agent-runner): stack on cleaned tool runtime fixes 2026-06-14 11:25:38 +08:00
huanghuoguoguo 1fbbf8d750 fix(tools): clear stale Python workspace env locks 2026-06-14 11:25:09 +08:00
huanghuoguoguo 5b9e541998 chore(agent-runner): stack on latest tool runtime fixes 2026-06-14 11:23:41 +08:00
huanghuoguoguo 4013f2ffd1 fix(tools): bootstrap Python workspaces with available interpreter 2026-06-14 11:23:09 +08:00
huanghuoguoguo a26f3c2afd chore(agent-runner): drop tool fix residuals from feature branch 2026-06-14 11:20:22 +08:00
huanghuoguoguo 2da174361f chore(agent-runner): stack on tool runtime fixes
# Conflicts:
#	src/langbot/pkg/provider/tools/loaders/mcp_stdio.py
#	tests/unit_tests/provider/test_mcp_box_integration.py
2026-06-14 11:19:12 +08:00
huanghuoguoguo cff9ac5683 chore(agent-runner): split litellm usage details 2026-06-14 11:16:17 +08:00
huanghuoguoguo 57c1a416e0 chore(agent-runner): stack on tool lookup split
# Conflicts:
#	src/langbot/pkg/provider/tools/loader.py
#	src/langbot/pkg/provider/tools/loaders/mcp.py
#	src/langbot/pkg/provider/tools/loaders/native.py
#	src/langbot/pkg/provider/tools/toolmgr.py
2026-06-14 11:16:11 +08:00
huanghuoguoguo 27be09ab15 fix(provider): preserve litellm usage details (#2246) 2026-06-14 11:12:29 +08:00
huanghuoguoguo 2f90e3c59b fix(tools): harden agent runner tool runtimes 2026-06-14 11:07:46 +08:00
huanghuoguoguo ee24398d80 feat(agent-runner): support host tool lookup 2026-06-14 11:04:52 +08:00
huanghuoguoguo 1ef4507d9a [codex] Delegate web page bot stream helpers (#2245)
* fix(platform): delegate web page bot stream helpers

* style(platform): format web page bot adapter
2026-06-14 10:57:53 +08:00