20 Commits
Author SHA1 Message Date
Jubaoliang 2de23da5f3 fix: keep remote experts, mentions, cron, and MCP schema errors accurate (#2355)
Cloud-collab shadows follow the peer runtime state and only expose start/stop for the peer owner. Chat @ mentions list files once through the workspace backend, interval cron edits no longer reset the next run, and output-schema MCP failures stay on the tool result.
2026-10-24 09:08:55 +08:00
42e41ed33e feat: add one-shot tasks and split personalization permissions (#2157)
Scheduled jobs can run once and then stop, personalization tabs can be granted separately, and rotated logs use a date-before-extension name.

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 07:11:24 +08:00
ed5fc0a9e4 fix: peer composer defaults, usage names, and cron titles (#2066)
* fix(chat): show peer expert composer defaults and theme the beta badge

Cloud collab shadow experts dropped the peer's model, connectors, knowledge
bases, and conversation mode, so the local composer could not show them.
The sidebar Beta chip also stayed a fixed red instead of the theme color.

* fix: name experts in usage stats and title cron sessions

Admin usage grouped other users' experts by id because the page only knew
the signed-in account's agents. Scheduled runs also left the thread untitled
until the next user message when the push failed or never ran.

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

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-15 13:04:57 +08:00
2ad157968f feat(connectors): support Agent Mail auth, tools and new-mail tasks (#1573)
* feat(connectors): add isolated Agent Mail CLI tools

* feat(connectors): add Agent Mail device authorization

* feat(dashboard): add Agent Mail connector setup

* docs(connectors): document Agent Mail and CLI verification

* fix(connectors): keep Agent Mail checks portable and focused

* feat(connectors): trigger cron tasks from Agent Mail watch

* feat(dashboard): configure Agent Mail new-mail tasks

* docs(api): clarify Agent Mail trigger examples

* style(dashboard): refine Agent Mail auth and task hints

* test(connectors): preserve Windows watch process cleanup

* fix(connectors): gate Agent Mail writes with HITL and cron read-only

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

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-04 14:15:35 +08:00
sxhandsxh313 728ca52106 fix(cron): a failed agent run still leaves its prompt in the thread (#984)
`fresh_thread` deliveries reset the session to a brand-new thread before the
run, but the history projection only happened after the response passed the
"visible reply" checks. A run that raised — a failing tool call, a HITL
request, an empty reply — therefore left that thread with zero rows, so
opening the conversation after 立即执行 showed a blank chat.

Project in a finally, the same way the interactive processor persists an
incomplete turn, so the prompt and whatever the model streamed before the
failure are recorded. Push and toast stay unchanged: nothing is delivered
until there is a visible reply.

Co-authored-by: sxh313 <sxh313@users.noreply.github.com>
2026-09-23 14:58:51 +08:00
1752bc634d fix(cron,hitl): date timezone + HITL resume expire on error (#890)
* fix(cron,hitl): date triggers use server timezone; expire HITL on resume error

Naive date: ISO times now honor default_timezone like cron:. Dashboard
HITL resume stream failures mark the pending record expired instead of
approved, so reinject safety no longer mislabels a failed resume.

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

* chore: drop unrelated uv.lock change from polish branch

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

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 12:01:43 +08:00
jubaoliang f0917aefb6 fix(cron): cron 触发按配置时区执行,而非宿主系统时区
Merged from #864.
2026-09-21 03:02:00 +00:00
jubaoliang 12e5b706cc feat(teams): add expert team hosts without changing 1:1 chat (#868) 2026-09-21 10:24:09 +08:00
IronMurphy 07ff90fc0a Reject non-positive interval cron triggers (#819)
An interval of 0 or a negative value produces fire times that stay at or
before the current instant, so APScheduler runs the job back-to-back
without waiting: in a local check, interval:-5 spun the event loop until
the process was killed. build_trigger already rejects invalid weekdays in
cron expressions; non-positive intervals are now rejected the same way,
and create()/update() surface the OctopError to the caller.
2026-09-19 20:45:36 +08:00
jubaoliangandCursor fcf23bdca4 feat: apply resource policy on user create and require cron job names
Admins can set storage-root and token quota when creating a user, and
cronjob_create now requires a display name with prompt-prefix fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 10:26:17 +08:00
jubaoliang 5b6c91302c feat: expert composer defaults (KB + MCP) and per-user policies
Allow experts and skill packages to carry composer defaults so that
installed/created agents start with the author's chosen knowledge bases
and MCP servers. Defaults are persisted as agent profile columns and
validated against the installing user. Adds the per-user policy resource
table (migration 014) and wires the dashboard composer fields plus
locale strings.

- Add knowledge_base_ids and mcp_servers to the agent profile schema
- Validate KB/MCP ids on expert/skill-package install and create paths
- Persist defaults via migrate.py helper and 014_user_policy migration
- Surface composer default fields in the dashboard expert/skill UI
2026-09-11 02:00:01 +08:00
liukewia d78522d019 refactor(dashboard): remove thread activity handling and related tests
- Eliminated the `parseThreadActivityFrame` function and its associated type, streamlining the dashboard push toast logic.
- Removed related tests that were verifying thread activity frame parsing, as this functionality is no longer needed.
- Updated the `useDashboardPushToast` hook to focus solely on dashboard push events, enhancing clarity and maintainability.

This refactor simplifies the codebase by removing unused functionality, improving the overall structure of the dashboard event handling.
2026-09-10 14:07:05 +08:00
liukewia adec3dd06c feat(chat): enhance session event handling and history management
- Introduced a new session event type "sessionsChanged" to handle proactive updates from the server, allowing the dashboard to refresh session lists and histories without a full page reload.
- Implemented functions to mark session histories as stale and trigger refetching when updates occur, improving data consistency.
- Added tests to verify the correct behavior of the new session event handling and history invalidation logic.

This update enhances the responsiveness of the chat interface by ensuring that users see the most current session information in real-time.
2026-09-10 14:07:05 +08:00
jubaoliang fc03a941c3 feat(cron): persist scheduled turns and keep gateway transport-only (#549)
Move cron delivery out of Gateway so dashboard text jobs write canonical history, AI jobs notify consistently, and inbound turns stay serialized with the published harness APIs.
2026-09-03 17:59:37 +08:00
liukewia c305010e86 feat(cron): add name field to cron jobs and update related interfaces (#525)
* feat(cron): add name field to cron jobs and update related interfaces

- Introduced a `name` field to the `OctopCronRow`, `OctopCronCreateBody`, and `OctopCronPatchBody` interfaces.
- Updated localization files to include validation messages for the new `name` field.
- Added a constant for maximum name length.
- Enhanced the UI to display the job name in the cron jobs table and detail views.
- Updated API documentation to reflect the new optional `name` parameter in cron job creation and updates.
- Implemented database schema changes to support the new `name` field in cron jobs.

This change improves the user experience by allowing users to assign descriptive names to their cron jobs, making them easier to identify.

* feat(cron): restrict cron job management to owners only

- Updated the cron job management logic to ensure that only the owner of a cron job can create, view, update, or delete it.
- Modified the API endpoints to return empty lists for non-owners attempting to access cron jobs.
- Enhanced the frontend logic to reflect these changes, ensuring a consistent user experience across the application.
- Updated related tests to verify that cron jobs are correctly scoped to their owners, preventing unauthorized access.

This change improves security and clarity in the management of cron jobs within shared agents.

* refactor(cron): improve code readability in cron management functions

- Reformatted the `_assert_cron_manage` function for better readability by adjusting the parameter layout.
- Simplified the invocation of the `create` function in the test case for clarity.

These changes enhance the maintainability of the code and improve the overall structure of the cron management logic.
2026-09-03 11:13:10 +08:00
jubaoliangandjubaoliang 86fa910449 feat: Docker sandbox, browser HITL stream, and gateway preemption (#227)
* feat: Docker sandbox, workspace_dir, default_open, HITL and runtime knobs

WIP against local editable orcakit-harness-agent 0.9.20 (PyPI not published yet).
Includes Admin Docker storage, agent workspace_dir, connector default_open,
chat HITL resume/todos UI, and runtime limit fields.


* feat: browser HITL stream listen, gateway preempt stop/cancel

Wire the browser streaming endpoint to listen for human-in-the-loop
events, add gateway-side preemption (stop/cancel) for running agents,
and integrate chat send with the browser session state.

- Add browser stream "listen" endpoint and harness HITL wiring
- Add gateway preemption: stop/cancel handling for running agents
- Wire chat send to browser session state in the dashboard
- Bump harness-gateway to >=0.9.2 and regenerate uv.lock
- Add unit tests for browser stream listen and gateway preemption

* test: fix workspace_dir assertion on Windows

Compare path components (name == agent_id, parent == "agents") instead
of a hard-coded POSIX "/agents/{id}" string suffix, so the check passes
on Windows where Path uses backslash separators.

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
2026-08-11 11:37:59 +08:00
Finn Lewis 4aab7c11ec Feature/migrate im channel cronjob from ace (#201)
* fix: Update schema when restoring octop/lightclaw backups

* feat: enhance error logging for OctopError in exception handlers

* feat: enhance backup restore process to include IM channel reloading

* feat: extend backup restore functionality to include cron job reloading

* feat: add JWT secret capture and restore functionality during backup processes

* fix: update Chinese translation for presetProviders term in zh.json

* feat: implement Unix crontab semantics for weekday handling in cron triggers

Added functionality to translate numeric Unix weekdays to names and updated the cron trigger builder to support Unix-style expressions. Enhanced unit tests to validate the new behavior for various weekday formats and ranges.

* feat: enhance backup restore functionality with ownership remapping

- Updated `restore_backup_file` to accept a `user` parameter for identifying the restoring admin.
- Added `owner_user_id` option in CLI for specifying ownership during LightClaw migration archives.
- Implemented user ownership remapping in the database during system backup restoration.
- Enhanced user handling in backup processes to ensure proper ownership assignment and data integrity.
- Updated tests to validate new ownership remapping behavior during migration restores.

* refactor: streamline SQL query formatting in backup test case

- Simplified the SQL query execution in the `_make_migration_backup` function by removing unnecessary line breaks for improved readability.
2026-08-10 21:43:14 +08:00
jubaoliang 2a3df89642 feat: global skill packages with ZIP import and personalization layout (#108)
* feat: add global skill packages with local ZIP import and personalization layout

Introduce instance-level skill packages (DB + disk), mount them on agents, and
support SkillHub/URL/ZIP import. Merge related schema into migration v2 and
cover the zip import path with frontend and API tests.


* fix: hot-sync skill package mounts and dark-mode package cards

Avoid full agent rebuild when mounting packages so Experts UI no longer
hits AGENT_NOT_FOUND; accept workspace-scoped local backends on Windows;
use theme token for package list card background.
2026-07-31 11:03:17 +08:00
薄生 dca16ccc21 Feat/postgresql dual backend (#60)
* feat: PostgreSQL dual-backend for control plane

Add SqlitePool|PostgresPool behind DatabasePool, parallel PG migrations,
setup wizard defer/bind, pg_dump backups with cross-engine refusal, and
memory defaulting to the control-plane DSN when using PostgreSQL.

* fix(chat): delete checkpoint data when a conversation thread is deleted

Deleting a thread only removed Octop's own metadata row; the actual
message history stayed in the agent's LangGraph checkpointer forever,
making "delete conversation" cosmetic. Also confirm before deleting a
session in the UI, since the action is now genuinely destructive.

Checkpoint deletion runs before the metadata row is removed: if it
fails outright (not just "nothing to delete"), the thread stays
visible/retryable instead of orphaning data with no remaining handle.

* fix(memory): stop suggesting pg_dump for portable export of postgres memory

The 501 hint told users to "use pg_dump on the memory schema instead".
That advice predates the shared-table layout: memory for ALL agents now
lives in one harness_memory schema isolated by a namespace column, so a
schema-level pg_dump would export every agent's memory, not just the
requester's — a cross-agent data exposure if followed on a multi-user
install.

Document the two migration models where the refusal is implemented:
sqlite memory is per-agent files moved via pack/adopt; postgres memory
is shared, and the supported way to use it from another host (e.g.
OpenClaw's harness-memory bridge with --backend postgres) is pointing
that host at the same DSN and namespace — shared, not migrated.

* fix(test): update test_slash_compact to renamed SqlitePool

The /compact test module still imported the pre-rename DBPool, which
broke collection (ImportError) on this branch after develop's compact
feature was merged in — DBPool was renamed to SqlitePool (the concrete
class) with DatabasePool now the Protocol.

DBPool -> SqlitePool at all three sites: the import, the _agent_manager
type hint, and the fixture's DBPool(path) instantiation. SqlitePool is
the byte-for-byte successor of DBPool and matches how every other test
constructs a pool; DatabasePool cannot be used at the instantiation
site (a Protocol is not instantiable).

pytest -m live now collects cleanly (31 selected, 0 errors);
test_slash_compact 3 tests pass.

* fix(test): make memory_backend db_path assertion separator-agnostic

test_explicit_sqlite_overrides_postgresql_control_plane compared the
resolved db_path against the literal "/tmp/ws/memory.sqlite", which the
code never produces on Windows: it builds the path with pathlib, so the
Windows CI job got "\tmp\ws\memory.sqlite" and the string equality failed.

Compare as Path objects so the assertion holds on every OS separator,
matching the .as_posix() discipline already used in test_config.py.
2026-07-24 14:45:53 +08:00
jubaoliang 748d998cf2 first commit 2026-07-09 14:32:36 +00:00