Repository navigation
Sync 2026-11-28: merge bytedance/main 579b12bbe (153 commits) - #140
Merged
Merged
Conversation
bytedance#8457) * fix(image-generation): validate provider download URLs before fetching The OpenAI-compatible image path fetched the provider-supplied data[].url with requests.get and default redirects, so a compromised provider could point the skill at a loopback, private or link-local service, or bounce a public URL through a redirect. Require HTTPS on port 443, a public host, and re-validate every redirect hop, mirroring the video-generation download guard. * fix(image-generation): constrain provider redirects and download status --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…#8429) Co-authored-by: zjy-boom <174030947+zjy-boom@users.noreply.github.com>
…dance#8451) * fix(opensandbox): sync enabled skills and per-agent projections * fix(opensandbox): retain workspaces on skill upload failure * test(opensandbox): make skill upload checks portable --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
* fix: 拒绝超过输出上限的压缩摘要 * fix: 识别原生 Ollama 摘要截断 * fix: 将 Ollama 截断检测限定在会话压缩
* fix(mcp): bound disconnected session cleanup wait * fix(mcp): use builtin timeout error in cleanup wait * style(mcp): normalize regression test file ending * docs(mcp): sync cleanup guidance with upstream * test(mcp): harden disconnect cleanup regression * test(mcp): assert owner reaper survives cleanup waiter * style(mcp): satisfy backend Ruff formatting * style(mcp): collapse teardown drain call per Ruff * style(mcp): satisfy Ruff formatting for cleanup regression * style(mcp): satisfy Ruff formatting for cleanup regression * style(mcp): wrap teardown drain for Ruff * style(mcp): satisfy Ruff formatting in disconnect regression * style(mcp): wrap cleanup owner assertion * style(mcp): format owner reaper assertion * style(mcp): respect repository Ruff line length * style(mcp): apply backend Ruff formatting * style(mcp): apply Ruff formatting to cleanup regression * style(mcp): format session cleanup regression test --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
* feat(setup): add keyless Rapid-MLX wizard entry Signed-off-by: nothingyuancando <1579035512@qq.com> * style(setup): drop unrelated writer formatting changes Signed-off-by: nothingyuancando <1579035512@qq.com> --------- Signed-off-by: nothingyuancando <1579035512@qq.com>
… write (bytedance#8475) * fix(memory): let OpenViking's write policy decide a refused non-owner write A write for a DeerFlow user other than owner_user_id was refused with MemoryManagerError before the write policy was consulted, so under the default write: log_and_drop the after-agent hook and the pre-compaction flush failed every turn for that user after the answer was generated. The owner check still runs before any OpenViking call. Under log_and_drop the refused write is now logged and dropped; write: raise still raises. * docs(memory): say the refused OpenViking write is what gets logged
…ce#8470) * fix(opensandbox): report a missing file as FileNotFoundError OpenSandboxSandbox.read_file turned every failed read into an "Error: ..." string and logged it at ERROR, including an HTTP 404 FILE_NOT_FOUND for a file that simply doesn't exist yet. The read-before-write gate reads the target before every write_file, so each new file an agent writes logged an ERROR, and the gate had to fail open because "missing" and "unreadable" looked the same. A not-found answer (a 404 anywhere in the cause chain, the provider's existing _is_not_found) now raises FileNotFoundError from the SDK error, like LocalSandbox; the gate and read_file already handle it (write_file creates the file, read_file reports not_found). It is logged at debug. Other read errors keep the "Error: ..." string and the ERROR log. A 404 still doesn't evict the sandbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(opensandbox): keep a renewal 404 as a dead sandbox, not a missing file Review follow-up (willem-bd): _file_op re-raises a failed renewal through the same path as the operation's own error, so a renewal 404 (sandbox expired server-side) was evicted correctly but then surfaced as FileNotFoundError, and the read-before-write gate treated a dead sandbox like a file that doesn't exist yet. The not-found translation now lives in _file_op behind missing_path and applies only to the operation's own failure; a renewal failure keeps its error. read_file and append-mode write_file opt in. Tests pin the renewal-404 read (red on the previous head) and append behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(opensandbox): let the remote line-number test's _file_op stub take keyword arguments _file_op now takes missing_path; the stub in test_remote_read_file_line_numbers.py accepted only the operation, so the two opensandbox cases failed with an unexpected keyword argument (CI backend-unit-tests (4)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
) * fix(runtime): page thread history from the before cursor POST /api/threads/{id}/history passed body.before as config.checkpoint_id to get_state_history, but LangGraph savers match checkpoint_id exactly in list(), so a before cursor always returned that single checkpoint. Treat it as the inclusive start of the walk (anchor, then list(before=anchor)), which is what the Gateway's degraded raw accessor already does and what its comment says the graph path does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(gateway): state that the history before cursor is inclusive LangGraph's own history API treats before as exclusive; spell out that this endpoint returns the cursor checkpoint first so paging clients do not double-count the boundary entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(gateway): clarify history pagination after cursor pruning --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
FileMemoryStorage kept one deep-copied document per (user, agent) scope it had ever read, with no cap. A scope that is only read is never evicted, and GET /api/memory accepts any well-formed agent_name, so one user could grow the cache by a document per request for the life of the process. The cache is now least recently used with a cap of 256 scopes. A hit or a write refreshes its scope, and an evicted scope is read from its files again.
* fix(smoke-test): sign in with an existing test account * fix(smoke-test): read session cookies from stdin
…ytedance#8468) * feat(extensions): add a workspace page to the run postmortem example The plugin now declares a PluginContribution: one page surface served from packaged assets plus three actions (latest, report, markdown) over the same service and derivation as the HTTP routes. The page prefills the current thread, loads the latest run the caller owns, renders verdict, anomalies, activity and a scrollable timeline, and downloads the Markdown report. A run the caller does not own answers {"not_found": true} rather than the action route's generic 422. The extension manifest id becomes the plugin namespace, the frontend catalog entry follows it, and the bundled documentation snapshot is regenerated. * fix(extensions): keep the postmortem page's thread prefill claim conditional The only page mount point today renders surfaces without a thread id, so SurfaceContext.threadId is undefined there; the page keeps supporting the optional field but the README and the module comment no longer promise a prefill the host cannot deliver. Also pin `loaded.plugins == ()` in both "nothing registered" tests so a future reorder cannot surface the sidebar page for a disabled extension. * test(runtime): control lease expiry during atomic admission * fix(extensions): make the postmortem's latest run and timeline honest about bounds The changed-run feed is ordered by change sequence across every thread in the evidence grant, so a bounded scan cannot prove a run is the newest. Only a scan that reached the end of the feed may answer a run; an incomplete scan now answers complete=false, and the page asks for a run ID instead of presenting an older run as latest. The page also reveals timeline events in 400-row chunks with "Show more", so every event in the response is reachable; the banner no longer tells users to raise Max events when the display cap was the limit. --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
* fix(dingtalk): handle multi-backtick inline code spans * fix(dingtalk): normalize inline code span padding Signed-off-by: Willem Jiang <willem.jiang@gmail.com> --------- Signed-off-by: Willem Jiang <willem.jiang@gmail.com> Co-authored-by: ZcWang <200940025+hajicheng@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…e#8485) * fix(github): separate webhook runs from tool authentication Signed-off-by: Willem Jiang <willem.jiang@gmail.com> * docs(github): explain App authorization for MCP Signed-off-by: Willem Jiang <willem.jiang@gmail.com> --------- Signed-off-by: Willem Jiang <willem.jiang@gmail.com>
…nce#8479) `mutate_run_inputs` calls `_next_change_seq` and drops the return value. It is the only one of the sixteen call sites in that module that does not assign it, and the only column the method writes is `run_inputs_json`, so the position it takes never reaches a row: after one append the clock moves 1 -> 2 while the run row's `change_seq` stays at 1. The clock is a single row, so that write is not free: every queued or steering message -- `RunInputs.submit`, `acknowledge` and `close` all land here, and `POST /api/runs/{id}/inputs` reaches it once per message -- buys a position nothing reads while serializing against every other run mutation in the database, and against every other writer on SQLite. Progress snapshots, lease heartbeats and deletes already stay off the clock for the same reason (bytedance#5516), and an append that rewrites one JSON column which no changed-run cursor observes belongs with them. The append still reads the row before it writes it, so SQLite needs its write lock up front; the clock bump had been supplying that as a side effect. `BEGIN IMMEDIATE` takes it directly, matching `delete` and `delete_by_thread`. Removing the clock without it would trade a wasted write for lost updates -- eight concurrent appends leave one item behind and report no error.
…ytedance#8323) * fix(sandbox): build the bash cwd prefix for the shell that runs it * fix(sandbox): stop when the shell cannot enter the workspace `Set-Location` reports a missing directory as a non-terminating error, so the semicolon-separated command still ran — from whatever directory the gateway was started in. Add `-ErrorAction Stop` so a vanished workspace aborts execution the way the POSIX `&&` form does, and add a regression test that also proves the command runs when the workspace exists. Pin the shell in the remaining POSIX-only prefix assertion so the test no longer depends on the host shell. * fix(sandbox): preserve Windows workspace paths at launch --------- Co-authored-by: huyengiang101086-spec <270684046+huyengiang101086-spec@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…e#8278) * fix(history): retain recaptured batches in checkpoint order * fix(history): derive archive retention from checkpoint state --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…ical order (bytedance#8243) * fix(runtime): compose cached delta history in the inner saver's canonical order _channel_writes() re-sorted a checkpoint's pending_writes by task_id only. The canonical per-checkpoint order is writes_sort_key = (task_path, task_id, idx): InMemorySaver returns pending_writes through _ordered_writes, which sorts by task_path first, and its native get_delta_channel_history walk collects with the same order. A stable task_id-only sort therefore reorders writes on fan-out supersteps whenever task_path order differs from task_id order, and the cached history then disagrees with the authoritative walk: an order-sensitive reducer rebuilds a different value from cache than from the inner saver. get_tuple() already hands us the canonical order for every supported backend (the SQL savers emit ORDER BY task_id, idx), so simply filter by channel and drop the re-sort. * docs(runtime): attribute sqlite ordering correctly and bump cache format to v2 Two follow-ups from review: - _channel_writes() claimed the SQL savers emit ORDER BY task_id, idx. Only postgres does (array_agg(... ORDER BY cw.task_id, cw.idx)); sqlite's pending_writes_sql has no ORDER BY and load_pending_writes sorts in Python by writes_sort_key(task_path, task_id, idx). The docstring now attributes each backend's ordering correctly, and notes the dropped task_id re-sort broke sqlite the same way it broke InMemorySaver. - CACHE_FORMAT_VERSION 1 -> 2: entries composed under the old task_id-sorted order still pass valid_history_entry (shape-only) and are keyed identically, so a Redis-backed deployment would keep serving mis-ordered histories until TTL expiry. The versioned default prefix orphans them on upgrade. Test pin and both mdx pages updated. * test(runtime): pin the default prefix assertion to CACHE_FORMAT_VERSION test_key_prefix_override_wins hard-coded startswith("ckpt-hist:v1:") and broke when the format version moved to 2. Derive the expectation from CACHE_FORMAT_VERSION so future bumps do not need to touch this test, and refresh the fake v1 prefix in the thread-purge test for consistency. * fix(runtime): attribute the postgres pending-writes order to _load_writes langgraph-checkpoint-postgres 3.1.3 (pinned in backend/uv.lock) aggregates pending writes with a bare array_agg(...) in SELECT_SQL -- no ORDER BY -- and the canonical writes_sort_key order comes from _load_writes sorting in Python, the same mechanism sqlite uses. The docstring claimed postgres orders with array_agg(... ORDER BY cw.task_id, cw.idx); that ordered aggregate only exists in the legacy pending-sends migration. Also record that the dropped task_id re-sort broke postgres the same way it broke sqlite/InMemorySaver. * fix(runtime): purge legacy Redis checkpoint history on thread cleanup * docs(checkpoint-cache): clarify no-TTL purge residue --------- Co-authored-by: laoyyu <laoyyu@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…ytedance#8486) * fix(persistence): fence thread status writes by owner in the UPDATE ThreadMetaRepository.update_status read the row to check ownership and then updated it by thread_id alone. A row that moved to another owner in between received the first owner's status. Put the owner condition in the UPDATE so the check and the write are one statement. * test(persistence): close the side SQLite connection in the owner-move test The sqlite3 connection context manager commits but leaves the connection open, which emits a ResourceWarning on Python 3.13.
…edance#8235) * feat(skills): allow injecting storage into activation middleware * feat(skills): share injected storage across skill consumers * fix(skills): project injected storage into the lead sandbox --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
bytedance#8354) * fix(todo): address malformed write_todos call ids before results exist The base TodoListMiddleware builds one error ToolMessage per parallel write_todos call from tool_calls[*]["id"], and the tool node does the same for a single call. A missing or non-string id raised a pydantic ValidationError and aborted the run before the model could retry; empty and repeated ids created results the next request cannot address, which backend/AGENTS.md forbids. TodoMiddleware.after_model now gives those calls synthetic ids and returns the same message with those ids (the messages reducer substitutes by message id), so the base hook and the tool node build valid results that pair with the call. Only structured tool_calls are relabelled; well-formed ids are left untouched. * fix(todo): relabel provider tool-call surfaces and reserve other-tool ids Addresses review on bytedance#8354: - Relabelling is now occurrence-aware and rewrites the provider's own surfaces (additional_kwargs.tool_calls and tool_use content blocks) as well as structured tool_calls, so a duplicate id no longer leaves extra blocks pointing at the old id in the next request. - Ids used by a non-write_todos call are reserved before a write_todos id is retained, so a todo call sharing an id with another tool is relabelled and every emitted result has a unique address. Tests cover provider surfaces matching the structured ids and a shared echo/write_todos id; both fail on the previous head. * fix(todo): preserve tool-call IDs in provider retries --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…8491) * docs(readme): clarify sandbox modes in the Chinese README * docs(readme): clarify when sandbox Bash is available --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
* feat(agent-teams): add optional PostgreSQL persistence * fix(agent-teams): propagate shutdown waiter cancellation * fix(tui): skip periodic refresh during shutdown
…odos (bytedance#8171) * fix(agents): verify reminder provenance before reusing its id * fix(agents): drop stale persisted reminder before skipping a matching write * fix(agents): supersede legacy todo reminders, reconcile cleared plans, render items as data * fix(agents): reject wrapper-only legacy reminders and announce a cleared plan * fix(agents): replace a stale reminder with the clear notice when the last write is still visible * fix(agents): skip the clear notice when the last write already cleared the plan * fix(agents): frame rendered todos as user input data * fix(agents): frame completion todo text as user input data Address the Codex P2 on 6adae99: the transient completion reminder appended unfinished todo text after </system_reminder> without the user-input boundary markers, so a natural-language directive inside a todo item was presented with framework trust. The items are now framed with the same --- BEGIN/END USER INPUT --- markers as the persisted reminder; _format_todos already neutralizes forged markers inside item text. Tests: backend/tests/test_todo_middleware.py 172 passed, including the new test_completion_reminder_frames_items_as_user_input (verified to fail on the pre-fix rendering); ruff check and format clean. * fix(agents): hash persisted todo reminder templates in release policy release_policy_parameters() hashed only the completion reminder template, so a wording change to the persisted edited/truncated/cleared reminder templates left the assembly policy fingerprint unchanged. Hash the three rendered templates with an empty item list, mirroring the completion reminder, and add a regression test pinning the new hash entry. * Merge upstream main into todo-reminder-edited-state Catch the branch up with upstream main (7b84fd0) to resolve the merge conflict with main. Conflict resolution: - backend/tests/test_todo_middleware.py: union of both sides' imports (keep RemoveMessage from this branch, add ChatGeneration/ChatResult from main); both are used by the merged file. All other upstream changes taken as-is, including upstream's removal of frontend/src/core/voice-input/speech-recognition.ts and its test in bytedance#8286. * fix(agents): reconcile saved todo reminders on resume --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
* fix: 保留 Jina 网页抓取的 HTTP 错误状态 * fix: Jina 响应体超限时保留 HTTP 状态码
…og, harness reference) (bytedance#8497) * docs: replace links to deleted PRs with commit permalinks (zh changelog, harness reference) * docs(changelog): repoint deleted PR references to commit permalinks in English changelog Follow-up to review feedback on bytedance#8497: the English CHANGELOG.md still contains the same seven reference definitions pointing to deleted PRs (3823, 3824, 4823, 4825, 4830, 4928, 5047). Apply the same pull/N -> commit/<sha> replacement already done for CHANGELOG_zh.md. Entry text unchanged; all 7 commit permalinks verified to resolve. --------- Co-authored-by: leom1919 <leom1919@users.noreply.github.com>
bytedance#8391) * fix(sandbox): park a boxd machine only when its last claim is released Two overlapping acquires in one scope record two claims, but the first release parked the shared machine in the warm pool anyway: its outputs were mirrored while the second claimant was still mid-turn, and another caller could reclaim the machine under it (bytedance#8382). _release_scope_locked now decrements the claim count first and returns while any other claimant is active; only the last release mirrors outputs and parks the machine. _drop_claim (abandoned async acquires) uses the same primitive instead of decrementing on its own, so the two paths cannot diverge. * fix(sandbox): scope Boxd claims to machine generations --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…gers Require GitHub webhook actors on user-authored events to match either allow_authors (with optional allow_authors_bypass_mention control) or allow_author_associations (defaulting to OWNER, MEMBER, COLLABORATOR) verified against sender.login == authored.user.login. Guard non-object JSON bodies and non-dict sender payloads, and align redundant review comment suppression with review trigger authorization. Signed-off-by: Eason Meng <eason.meng@bytedance.com>
* docs(config): clarify support bundle thread lookup * docs(config): show how to include a thread manifest `make support-bundle` passes only `--include-doctor`, so reporters following the guide got a bundle without `thread-summary.json`. Document the direct `--thread-id` invocation from the checkout root. Also explain that a standalone Gateway resolves a relative `DEER_FLOW_HOME` against its own working directory, so the reporter has to export the absolute path the Gateway is using instead of a relative value.
…bytedance#8697) * feat(sandbox): structured run error and UI toast for sandbox capacity A run that acquires its sandbox before the model runs fails with SandboxCapacityExceededError when the provider has no capacity. The run error event carried only message and name, so clients parsed the code and retry hint out of the text and the UI showed the raw message. The error event now adds code, retryable and retry_after_seconds for errors with a structured details dict, and the web UI says the sandboxes are busy and to try again shortly. Refs bytedance#8586 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> * fix(sandbox): omit non-finite retry hints; neutral sandbox-unavailable toast Review on bytedance#8697: a NaN or infinite retry_after_seconds would be written as a bare token the LangGraph SDK rejects, losing the whole error frame; it is now omitted while code and retryable still arrive. The toast no longer claims every sandbox is busy: the same error appears while a provider's capacity store is initialising or shutting down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> * docs(api): document structured SSE run errors --------- Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…nce#8682) * fix(threads): keep failed branch checkpoints tied to an owner Reserve the child and persist its metadata before copying the replay base and head. Reconcile a lost insert acknowledgement and keep the ownership row until checkpoint rollback succeeds. * fix(threads): fence branch writes after child reservation loss Confirm the child admission before each insert, checkpoint write, and rollback step. Drain each operation individually so a cancelled request can finish its current write without starting another after a takeover. Exercise ownership loss during the insert, replay-base write, failing head write, and checkpoint cleanup with two RunManagers sharing SQLite.
…docs - Require a valid dict sender with non-empty login in _author_login() and _author_association() so missing or null sender fields fail closed. - Deep-copy resolved trigger configs in _resolved_trigger() so default allow_author_associations lists are never shared across bindings. - Clarify organization-repo scoping in GITHUB_AGENTS.md and keep require_mention exercised in third-party bot dispatcher tests. Signed-off-by: Eason Meng <eason.meng@bytedance.com>
…bytedance#8717) `backend/README.md` still described the default backend suite as four parallel shards. `backend/Makefile` runs six (`TEST_SHARD_TARGETS` is test-shard-1..6, `make test` passes SPLITS=6) and the CI matrix in `.github/workflows/backend-unit-tests.yml` uses `shard: [1, 2, 3, 4, 5, 6]`, so the recipe understated the parallelism and could send a contributor looking for a fourth-shard-only failure that does not exist. The exclusion list was also incomplete: the make target selects `-m "not live and not bundled_extension and not benchmark"` and ignores `tests/blocking_io`, so bundled-extension and benchmark tests are excluded too. Align both documents with the target and with each other.
…eedream, and Seedance 2.5 skills (bytedance#8701) * feat(byteplus-agentplan): integrate BytePlus Agent Plan across LLM, Seedream, and Seedance 2.5 skills - Add `byteplus_agentplan` provider to `skills/public/video-generation` for Seedance 2.5 (`dreamina-seedance-2.5` / `dreamina-seedance-2.5-flash`) with multi-reference image support, native audio generation, same-origin redirect enforcement, BytePlus TOS download allowlist, and clear tier-upgrade guidance on HTTP 403 rejections. - Add `byteplus_agentplan` provider to `skills/public/image-generation` for Seedream (`dola-seedream-5.0-pro` / `5.5` / `5.0-flash`) with JSON reference images and safe decode-before-write handling, powering `ppt-generation` with the same API key. - Register `byteplus-agent-plan` in `managed_model_providers.py` and `byteplus_agentplan` in the interactive `make setup` wizard (auto-forwarding `BYTEPLUS_AGENTPLAN_API_KEY` into `sandbox.environment`). - Update `.env.example`, `provider_credentials.py`, `config.example.yaml`, READMEs, skills guide, and Ark model-provider docs. * fix(byteplus-agentplan): address review feedback on vision, Seedream prompt/format/aspect ratio, and test return flow * docs(byteplus-agentplan): append DeerFlow UTM parameters to BytePlus Agent Plan console and doc links * fix(byteplus-agentplan): require opt-in for sandbox key sharing and validate Seedream images before writing
…nce#8331) * fix(memory): rescue at-risk reserved facts below eviction cap * fix(memory): draw hybrid reserve from ranking tail to keep repeated writes bounded --------- Co-authored-by: Totoro <msy626836554@gmail.com>
…ing veFaaS doc coverage (bytedance#8719) * docs(vefaas-sandbox): append DeerFlow UTM parameters to BytePlus veFaaS links * docs(vefaas-sandbox): complete veFaaS coverage in CONFIGURATION.md, deployment guides, and ZH configuration docs
…code (bytedance#8721) The login page looked the `?error=` value up in the localized error table with plain indexing, so an inherited key resolved. `__proto__` returned Object.prototype, which React refuses to render, and `useState` called the function behind `constructor`, `valueOf` or `hasOwnProperty` as an initializer. Each one replaced the page with Next's error screen, and the server render answered 500. `toString` showed "[object Undefined]". Only the table's own keys now name a message. Any other code shows the generic "Authentication failed." as unknown codes already did.
…ytedance#8662) * fix(sandbox): keep line endings when str_replace edits a file on AIO AioSandbox.read_file read through the AIO /v1/file/read route, which returns text with every CRLF and bare CR turned into LF. str_replace then saw no CRLF, so changing one word in a CRLF file wrote every line back as LF; CR-only and mixed-ending files were rewritten the same way. The write route stores "\r" as given, so only the read was lossy. read_file now reads the stored bytes through the download route and decodes them as UTF-8, so a full read returns line endings as stored, as on the local sandbox since bytedance#6343. Ranged reads are sliced with split_file_lines, as on E2B, BoxLite, Tenki and OpenSandbox: the server's ranges also ended lines at a bare CR, form feeds and Unicode separators, and would no longer agree with the start_line a truncated full read suggests. A missing file, a directory, a file the server cannot open and a non-UTF-8 file still return "Error: file not found or unreadable". A file over the 100 MB download limit raises instead: an error string would let str_replace replace text inside it and write it over the file. * fix(sandbox): match str_replace snippets that span mixed line endings A ranged read joins lines with "\n", so an old_str copied from a file that mixes CRLF and LF lines matched neither its literal nor its all-CRLF spelling once read_file returned the stored endings. Match it against the file with CRLF read as LF and replace only the original span, so line endings outside the edited text stay as stored; new_str takes the ending of the span's first line break. HarnessGuard splices through the same helper. * fix(sandbox): block writes over an AIO file too large to read back AioSandbox.read_file raises OSError(EFBIG) for a file over the 100 MB download limit, so that str_replace never writes an error string over it. The read-before-write gate caught that exception in its generic handler and failed open: write_file could replace an existing AIO file over 100 MB without any read, which the gate blocked before, when the read route returned the content. On a live AIO 1.11.0 container, write_file replaced a 110 MB file that had never been read. No read can ever mark such a file, so the gate now returns a blocked result for EFBIG, with the usual write-block metadata, telling the model to use bash instead. This covers write_file, appends and str_replace, on the sync and async paths. Other inspection errors still fail open, and a new file is still created. * fix(sandbox): copy only the selected lines in an AIO ranged read A ranged AIO read_file split the whole downloaded file into a list of every line before slicing. On a 100 MB file of short lines one read peaked at about 2 GB of extra memory in the Gateway; on main the server sliced ranges itself. slice_file_lines returns the same text as joining the split_file_lines slice, with the same clamping, but counts newlines block by block and copies only the selected lines. The same read now needs a few kilobytes and runs in under 0.1 s instead of 1-5 s. A property test checks it against the split-and-join result on random content. * fix(sandbox): match str_replace snippets in file order whatever their line endings str_replace tried the literal and the all-CRLF spelling of old_str over the whole file before it looked for a snippet that spans CRLF and LF lines. When a ranged read spanned mixed endings and the same text recurred later with LF only or CRLF only, a default edit changed the later copy and returned OK, and replace_all left the mixed copy alone. The offset table behind the mixed search also kept one integer per CRLF in the file: 1.6 GB of extra memory for one edit in a 100 MB file of short lines. The matcher now has one rule instead of fallbacks. In a file with CRLF, a CRLF is one line break; a "\r\n" in old_str matches only a CRLF, a "\n" matches either ending, and every other character matches itself. Matches are taken in file order without overlapping, as str.replace takes them. The n-th line break of new_str is written in the ending of the n-th line break inside the match, so an edit that keeps the line count keeps every line's ending, and no match splits a CRLF. A file without CRLF is still matched literally, and a file whose breaks are all CRLF, or an edit without line breaks, still runs as one str.replace, which the tests show gives the same result. Match boundaries are mapped by counting CRLFs forward from the previous match, so the extra memory stays near three times the file (the CRLF-as-LF copy and the output) whatever its newline density: 292 MB for that edit instead of 1.6 GB. An empty old_str is a no-op here too, so the HarnessGuard syntax check no longer blocks an edit that str_replace would not make. Tests: a hypothesis reference model of the rule on files that mix "\r\n", "\n" and "\r", with snippets from ranged reads, full reads and typed text; parity with main on files with one ending; ranged-read snippets are never reported missing; the real str_replace and the HarnessGuard splice against the model. The AIO tests now run the real agent_sandbox client over an httpx transport that serves the download, read and write routes as AIO 1.11.0 does, including the ordering cases and the oversized-file gate. * fix(sandbox): keep ranged reads and str_replace matching linear A ranged read dropped the carriage returns that end each line with the regex \r+(?=\n). On a run of bare \r followed by ordinary text the lookahead failed and the search retried from every \r of the run, so the read was quadratic in its length: 15 s for an 80,000-character run through the AIO SDK. The same sub also built a list with two entries per CRLF line, 220 MiB for a ranged read of a 10 MB CRLF file. The read now turns each \r\n into \n with str.replace, and only when a line ended in several \r does it cut each run with one find and rstrip per such line, writing to a StringIO. Every character is read a fixed number of times, and the result equals joining the split_file_lines slice as before. The str_replace matcher had the same class of problem. A snippet with \r\n was searched with CRLF read as LF and each overlapping candidate was then checked position by position, so a CRLF snippet over many LF lines cost the file length times the snippet length. Accepting a snippet whose \r\n and \n may land on any mix of endings is a subset match, which no forward scan does, so a snippet with \r\n now matches as written or with every line break spelled CRLF, the two spellings main tried, in file order; a leading \n may also be the LF of a CRLF, since such a snippet cannot show the ending of the line before it. A snippet without \r\n, as a ranged read or the model writes it, still matches with each \n as LF or CRLF. Each spelling is found with str.find; only a spelling that ends in a bare \r and occurs right before an LF uses a regex, whose literal prefix re scans with a KMP overlap table, so candidates that would split a CRLF are skipped without rescanning them. Tests: a growth check (tests/support/scaling.py) compares the thread CPU time of a 16x larger adversarial input with a small one and requires under 64x, where linear is about 16x and quadratic 256x. It covers CR runs, CRLF and multi-CR lines for ranged reads, through the real AIO SDK too, and rejected candidates, CR runs and replace_all with many matches for the matcher. The old code fails it at 180x to 277x, a find-and-retry finder at 300x to 400x, and it passed 72 of 72 runs with the CPU four times oversubscribed. The reference model follows the new rule, a full-read snippet that does not split a CRLF is never reported missing, and the ranged-read property test draws runs of \r.
bytedance#8735) PyYAML's timestamp constructor raises ValueError/AttributeError for an explicit date-like value it cannot build, not a YAMLError. The standalone validator and the optimizer's parser caught only YAMLError, so such a SKILL.md tracebacked instead of reporting invalid frontmatter. Catch the same tuple as the backend frontmatter helper and keep the existing clean error paths.
* feat(models): add NVIDIA NIM provider preset * fix(wizard): allow custom NVIDIA NIM model IDs * fix(wizard): infer NVIDIA NIM vision support --------- Co-authored-by: laoyyu <laoyyu@users.noreply.github.com>
…ytedance#8704) * feat(usage): count subagent batch items in thread and console usage Batch items run outside any run, so the run-based usage views never saw their tokens. The thread token usage, the console usage and the console stats now add each item's stored usage (all attempts, bytedance#8647): to the totals, by model and, for a thread, as subagent work. New count fields (total_batch_items, a day's batch_items) say how many items are included; runs counts stay counts of runs. Fixes bytedance#8646 (part 2; part 1 was bytedance#8647). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> * fix(usage): price batch items per model and attempt, refresh thread usage Review of bytedance#8704: - A batch attempt now stores its tokens per model (provider-reported, else the item's model) with cache hits, and each attempt is kept with the time its usage was written. The console prices every model at its own rate with the configured cache-hit price, in both /stats and /usage. - Batch usage is dated by the attempt that spent it, not by completed_at or updated_at: a manual retry or a lease renewal no longer moves earlier tokens into a later day or window. Usage stored before this change still counts, at the item's model and its old timestamp. - total_batch_items and the daily batch_items count items, not attempts. - The chat header refetches the thread's usage when batch item counts move, also for a batch without a continuation. - The usage page treats a window with only batch item usage as non-empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> --------- Signed-off-by: Bas Cancrinus <7222814+bascan@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(coordination): run tasks from Feishu private chats * fix(coordination): handle Feishu upload transport failures and mute races * fix(channels): reserve Feishu /task start only when coordination is enabled * chore(ci): retrigger checks
…e#8728) * feat(models): add MiniMax-M3.1-Flash to the MiniMax presets The setup wizard's MiniMax and MiniMax CN presets now offer MiniMax-M3.1-Flash, and a managed MiniMax-M3.1-Flash profile gets vision plus required thinking. The model always thinks and rejects thinking.type=disabled, so it takes the M2.7 reasoning contract rather than M3's optional one. * test(models): cover MiniMax-M3.1-Flash presets and document it The managed required-thinking test now covers MiniMax-M3.1-Flash in both regions, including vision and no thinking-disable payload, and the wizard test checks it is offered with vision and without a disable template. CONFIGURATION.md lists the model next to the other MiniMax examples.
* fix(github): enforce fail-closed author authorization on webhook triggers Require GitHub webhook actors on user-authored events to match either allow_authors (with optional allow_authors_bypass_mention control) or allow_author_associations (defaulting to OWNER, MEMBER, COLLABORATOR) verified against sender.login == authored.user.login. Guard non-object JSON bodies and non-dict sender payloads, and align redundant review comment suppression with review trigger authorization. Signed-off-by: Eason Meng <eason.meng@bytedance.com> * fix(github): require webhook sender identity and clarify org trigger docs - Require a valid dict sender with non-empty login in _author_login() and _author_association() so missing or null sender fields fail closed. - Deep-copy resolved trigger configs in _resolved_trigger() so default allow_author_associations lists are never shared across bindings. - Clarify organization-repo scoping in GITHUB_AGENTS.md and keep require_mention exercised in third-party bot dispatcher tests. Signed-off-by: Eason Meng <eason.meng@bytedance.com> --------- Signed-off-by: Eason Meng <eason.meng@bytedance.com>
…tedance#8742) * fix(agent): clear only abandoned todos when replacing work * docs(agent): describe todo behavior when replacing work * fix(agent): clear abandoned todos in the replacement tool step
…ance#8713) * fix(helm): initialize bundled PostgreSQL on root-owned volumes Initialize new databases in a subdirectory owned by the PostgreSQL user and reuse existing databases at the volume root. Preserve that layout for official PostgreSQL 16 numeric tags and their digest-pinned references. Fixes bytedance#8707 * fix(helm): preserve the PostgreSQL data directory across registry mirrors * fix(helm): respect PostgreSQL image entrypoints and layout overrides * test(helm): cover PostgreSQL image data directory selection --------- Co-authored-by: juemimgcd <juemimgcd@users.noreply.github.com>
Do not publish a generation or export results after a requested CSV fails to load, an input is missing, or a file type is unsupported. Invalidate older cache identities without removing previously published files.
…inished run (bytedance#8714) Chrome for Android exposes the Notification API and grants permission, but its constructor throws: only a service worker can create a notification there. The chat pages show the notification from the thread's onFinish listener, and the SDK calls onFinish inside its stream try. The throw reported the finished run as a stream error, showed the raw TypeError as an error toast, and skipped the finish bookkeeping that refreshes the thread list. The notification hook now contains a constructor failure and starts the rate limit only after a notification is created. useThreadStream also contains a throw from the page listener so the finish bookkeeping always runs.
* fix(helm): retain the workspace PVC on uninstall * docs(helm): clarify workspace retention migration and recovery * test(helm): verify the default workspace PVC is retained --------- Co-authored-by: juemimgcd <juemimgcd@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
…nce#8700) * fix(provisioner): roll back only the Pod this request created A Pod create that loses the 409 AlreadyExists race belongs to the concurrent creator. When the loser's Service create then fails for an unrelated reason, the unconditional rollback deleted the winner's Pod, tearing down a sandbox another Gateway replica was waiting on. Track whether this request created the Pod and skip the rollback otherwise. The double-409 idempotent path and the self-created-Pod rollback are unchanged. Regression and decision-table tests pin all four Pod/Service race outcomes plus the Pod-create failure branch. * fix(provisioner): confirm Service absence before rolling back the Pod A Service create that reports an error may still have committed: a peer that discovers the Service can already serve the Pod through it, and the rollback would then leave that peer with a dead sandbox. Read the Service back before deleting; only a 404 confirms absence, and an existing or unknown Service keeps the Pod. Adds the committed-Service and unknown-state regressions to the provisioner threading suite and states the confirmation rule in the multi-replica README section. * fix(provisioner): coordinate Pod adoption with rollback and orphan cleanup Mark every Pod a create serves before reporting it Running, fence rollback and sweep deletes on a fresh read plus UID/resourceVersion preconditions, and ignore stale adoption marks. Confirm the Service is absent before any rollback and keep the Pod when its state is unknown or a transport error occurs. Sweep Pods no Service addresses at startup and on creates that reach the creation path. Add Pods patch RBAC and document the protocol, its upgrade requirements, and its boundaries. * fix(provisioner): fence adoption marks and re-check sweep services A create that serves a Pod it did not create, or whose own Pod was replaced, attests and marks that Pod before reporting Running: a Terminating Pod now yields 409 instead of a false success, with or without capacity requirements, and the mark is a strategic merge patch carrying the immutable Pod UID, so it cannot land on a same-name replacement. A lost-race create marks the Pod once before the access-URL wait and again after the final attestation, so a concurrent creator's rollback keeps the Pod during the wait. The orphan sweep re-reads the Service before the conditional delete, so a Service created or restored after the list keeps the Pod.
…#8753) * docs(tui): explain when terminal threads appear on the web * docs(tui): require a shared PostgreSQL schema
…iders (bytedance#8720) * fix(sandbox): keep user-uploaded data files searchable on remote providers The user-data exemption (bytedance#8366) and explicit-glob precedence (bytedance#8408) only landed on the local provider. All six remote providers filtered /mnt/user-data with the full repository rules, so an uploaded app.log was invisible to ls/glob/grep even with an explicit *.log glob; remote ls hid it twice (server-side find -prune and the parser). The shared helper gains a user_data/glob channel and one rule-split point; remote_list_dir prunes only repository machinery and in-flight uploads on a user-data root. E2B and Tenki label the original virtual path before their home-dir rewrite; the other four label the resolved virtual path. The documented home-root trade-off is pinned by a test. Boxd joins the shared contract provider list and a user-data fixture exercises every provider's real path mapping. * test(sandbox): use a neutral glob in the home-root trade-off case An explicit *.log glob wins in either root type, so the negative direction must use a pattern that does not name a data-looking file; the old assertion contradicted the explicit-glob precedence it sits next to. * fix(sandbox): address search review findings on remote providers - Keep only files before the AIO glob cap, honor hidden entries when directories are requested, and forward an explicit grep glob to the server while the client still enforces the directory scope. - Report E2B results under the virtual prefix so callers can reuse them, and resolve virtual aliases before disabled-skill filtering on E2B and Tenki. - Normalize equivalently spelled sandbox paths for user-data labeling, search scoping, and skills access checks. - Document the AIO grep image requirement and the file API surface, and cover the new paths with provider and tool tests. * fix(sandbox): narrow the AIO glob fallback listing by extension Images without /v1/file/glob (the default frozen latest tag is v1.0.0.156) answer 404, so files-only glob falls back to a recursive listing. That listing has no pattern or limit parameter, so a search for one file walked the whole tree: on a 1,001-file root the response was 165 KB. The listing does accept file_types. When the pattern ends in a literal extension every match has it, so the extension is pushed down and files with other extensions stay in the sandbox: the same 1,001-file search drops to 480 B on v1.0.0.156. Directories and hidden entries are still returned, so the client-side directory filter, the include_dirs branch, and the earlier show_hidden fix are unchanged. find_files was not used because it returns plain paths, including directories, with no way to tell them apart. Patterns without a derivable extension (**, *.*) still list the whole root; the endpoint has no result limit. A file whose whole name is the extension (a dotfile such as .gitignore searched as *.gitignore) is filtered out by the server and is documented as the cost of the push-down. * fix(sandbox): keep dot-only names in the AIO glob fallback The 404 fallback pushes a literal extension from the glob pattern down as `file_types`. The listing endpoint reports a name that is only dots plus the extension (`.csv`, `..csv`) with no extension, so that filter dropped matches the client matcher accepts (`*.csv`, `?*.csv`), silently and with no truncation signal. Skip the push-down when the pattern's stem can match a run of dots, which covers the extension-less class under both `os.path.splitext` and pathlib's extension rule. Patterns that still push are unchanged; the common wildcard shapes (`*.log`, `*.txt`) keep the full listing, which is the price of never dropping a match. Tests pin both branches on the fallback and the `include_dirs` listing, plus a contract case across providers with `.csv` and `..csv`. * fix(sandbox): search with in-sandbox find in the AIO glob fallback The /v1/file/list fallback has no pattern parameter and truncates at 10,000 entries before the ignore rules run, so a match behind a large ignored tree (node_modules) came back empty with truncated false. The extension push-down kept results correct only until a pattern's stem could match a dot-only name, at which point the full listing walked into that cap. Search inside the sandbox instead. find applies the basename coarse filter and the ignore prune during the walk, so unrelated files and ignored trees never reach the client or consume the cap. The client still re-applies path_matches and the ignore rules, and head is asked for one line past the candidate budget so an exact fit is not reported as truncated. A glob whose root is a file raises NotADirectoryError, matching the local walk. Verified on the frozen default image (v1.0.0.156, GNU findutils 4.8.0): a README beside 10,000 node_modules files is found with truncated false, 300 candidates at a cap of 10 report truncated true, dot-only names still match, and a file root raises. Removes _pattern_file_types and the dot-run guard it needed. * fix(sandbox): search nested files for AIO basename globs The typed glob endpoint anchors its pattern at the requested root, so a basename-only pattern such as *.txt returned only direct children while DeerFlow's matcher accepts it at any depth. Prefix the basename patterns with **/ for the request while keeping the caller's pattern for client filtering, and translate a bare ** to **/* so it keeps returning the tree instead of nothing. Also derive the disabled-skill verdict key from the normalized path. The enabled-state check normalized paths but the cache key sliced the original spelling, so equivalent spellings could share one verdict between a public and a custom skill with the same name.
16 conflicted files resolved intent-first. No patch retires on upstream's side: no new commit meets a Delete-when. Re-expressed onto upstream's new designs: - #72 batch str_replace and #73 workspace_patch onto bytedance#8662's _replace_keeping_line_endings. The _match_line_endings helper #72 called is gone (as merged, every batch edit raised NameError), and AIO reads now keep CRLF, so #73's literal match would answer not-found on CRLF files. - #99 shell-grep fallback around bytedance#8720: the API request keeps upstream's glob include inside the 404 guard; the shell path gets the same --include pre-filter and, under /mnt/user-data, USER_DATA_IGNORE_PATTERNS. - #75 active user request through bytedance#7667's _render_summary_prompt; the policy fingerprint keeps our key next to bytedance#8437's. - #120 launcher context next to bytedance#8598's subagent_enabled (run_context; the upstream local named context shadowed our parameter). - #53 allowed_tools ceiling applied after restrict_batch_continuation. Combined without change: #10 coalescer and channel owners beside the coordination dispatch, #15 SSO branch after bytedance#8514's PAT scopes, #121 untraced preload before the combined storage sweeps, bytedance#174 tier keys in the runtime-only set bytedance#8485 cut github_token from. Changed on the merge: #68 stops on bytedance#8608's capacity tool error like transient (it is stamped recoverable_by_model=True). #83 marked RETIRED (nothing left since 11-21) and its stale bash.inspection example removed. Fork notes in three AGENTS.md files shrink to one-line pointers under the 6 KiB budget. Four fork tests follow upstream's skill_storage and imported_history arguments. Upstream brings migrations 0059 to 0064 (additive, clean downgrades) and config_version 68 (local host bash retired). Tests: ruff clean; backend suite in six shards 43,331 passed with the 12 failures above fixed and re-run (150 passed); blocking_io 510 passed. Not runnable on this host: live Docker tests and test_docker_sandbox_mode_detection.py (docker.sock is root's podman). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Weekly upstream sync per acropolis
docs/DEERFLOW-SYNC.md. Base moves1c286b933(2026-11-21) to579b12bbe(2026-11-28), 153 upstream commits. Merge with a merge commit, not squash (the sync guard refuses a squashed sync, and the base must stay an ancestor).What the merge did
16 conflicted files (23 hunks) resolved intent-first; the commit message lists each. No patch retires on upstream's side.
Re-expressed:
_replace_keeping_line_endings. As merged, sync(argus): merge bytedance/main 3f0b6ecc (237 commits; retire #63, #80, #67-backend) #72's batch loop called the deleted_match_line_endings(NameError on every batch edit). AIO reads now keep CRLF, so ci: stop reviewing upstream's public skills on a sync #73's literal match would have said "not found" on CRLF files.include); the shell fallback the pinned sandbox always takes gets the same--includepre-filter andUSER_DATA_IGNORE_PATTERNSunder/mnt/user-data, so uploaded logs stay searchable._render_summary_prompt.subagent_enabled; Revert unproven work-cycle efficiency patch #53 afterrestrict_batch_continuation.Changed on the merge:
capacity(upstream fix(sandbox): report retryable capacity errors from tools bytedance/deer-flow#8608, full sandbox pool, stamped recoverable) hard-stops liketransient. New test.bash.inspectionconfig example removed. Stale Delete-when lines of Fix asyncpg DSN handling for PostgreSQL app persistence #45 and Revert unproven work-cycle efficiency patch #53 reworded.AGENTS.mdfork notes shrink to one-line pointers (6 KiB budget, upstream's text grew). Four fork tests follow upstream's newskill_storage/imported_historyarguments.Upstream changes to watch at the canary
loop_capped.;/loop command; check it through sync: 2026-04-28 — absorb 54 upstream commits #1/Scheduled runs in a web chat (patch #120) #104's wrapper./v1/file/glob, 404 on the pinned sandbox, falls back tofind. Acropolis [Question] 这个项目和龙虾的区别是啥呀? bytedance/deer-flow#1959 adds the canary's known fallback.config_version68 (host bash retired; every stack runs AIO).Tests
tests/blocking_io: 510 passed.test_docker_sandbox_mode_detection.py(docker.sock is root's podman). CI covers both.core/artifacts/utils.ts; left to CI.Ledger
PATCHES.md: base, "Sync 2026-11-28" one-liner, a sync bullet on each re-expressed section, #83 retired.🤖 Generated with Claude Code