4934 Commits

Author SHA1 Message Date
Aling33
0ebf8ce7b2
fix(gateway): refuse artifact share imports where the writer is unavailable (#8402)
* fix(gateway): refuse artifact share imports where the writer is unavailable

The descriptor-confined import writer needs O_DIRECTORY, O_NOFOLLOW and
dir_fd, so a non-POSIX Gateway answered POST /api/shares/{token}/fork with a
500 AttributeError after it had already created the destination thread and
rolled it back. Capture already refuses the same artifacts with 422, so the
import path now returns that contract before any workspace state exists.

* fix(gateway): refuse artifact share imports where the writer is unavailable

The descriptor-confined import writer needs O_DIRECTORY, O_NOFOLLOW and
dir_fd, so a non-POSIX Gateway answered POST /api/shares/{token}/fork with a
500 AttributeError after it had already created the destination thread and
rolled it back. Capture already refuses the same artifacts with 422, so the
import path now returns that contract before any workspace state exists.

* fix(gateway): refuse artifact share imports where the writer is unavailable

The descriptor-confined import writer needs O_DIRECTORY, O_NOFOLLOW and
dir_fd, so a non-POSIX Gateway answered POST /api/shares/{token}/fork with a
500 AttributeError after it had already created the destination thread and
rolled it back. Capture already refuses the same artifacts with 422, so the
import path now returns that contract before any workspace state exists, and
the sharing guide states the requirement next to the endpoint.
2026-11-21 20:45:33 +08:00
Wenchao An
5eb78f6530
feat(voice-input): enable dictation with a configured STT service (#8286)
* feat(voice-input): enable dictation with a configured STT service

* fix(voice-input): bound provider responses and warn on old configs

* fix(voice-input): redact config errors and validate transcripts
2026-11-21 20:44:37 +08:00
Hu Hongwei
ee72fe281c
fix(frontend): localize the sidecar send button's accessible name (#8418)
* fix(frontend): localize the sidecar send button's accessible name

* test(frontend): align sidecar E2E with localized send name
2026-11-21 20:42:18 +08:00
Loveca
dccb163836
fix(subagents): start subagent execution timeout at admission (#8356)
* fix(subagents): start execution timeout at admission

Queue wait was charged against timeout_seconds on both the async and
sync paths, and the task tool charged PENDING polls against its main
poll budget. Start the execution clock when a capacity slot is owned,
split the poller's queue and execution allowances, and report the actual
polling window on polling_timed_out.

Fixes #8308

* fix(subagents): ignore closed-loop admission waiter cancel

The isolated loop can close while the synchronous wrapper is still being reclaimed during teardown, so scheduling the waiter's cancellation raises RuntimeError. There is no loop left to wake, and the warning only surfaced in combined test runs.

* fix(subagents): count the admission-to-supervisor gap in the timeout

Record the monotonic start when the capacity slot is granted and let the wrapper wait only for the remaining budget. Synchronous work between admission and the supervisor waking previously started a fresh full timeout, so a one-second limit could be escaped by blocking the loop for 1.2 seconds immediately after admission. Completion after the deadline now counts as a timeout on both async and sync paths.

* fix(task): recheck terminal state before a polling timeout

The poller checked its budget immediately after the final sleep and returned polling_timed_out without reading status again. A subagent that completed during that sleep was reported as stuck and cancelled. Re-read the result only when the budget is exhausted so a terminal state still wins; the merge base had the same edge case.

* fix(subagents): settle timeout races before publishing results

Signed-off-by: Willem Jiang <willem.jiang@gmail.com>

---------

Signed-off-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-21 20:24:40 +08:00
Cosolar
900d1b65eb
fix(gateway): reject an end_at past the UTC range (#8465)
* fix(gateway): reject an end_at past the UTC range

resolve_end_at only mapped ValueError to the coded 422. A valid wall time near datetime.max moves past year 9999 when converted to UTC, so the OverflowError escaped admission and the request failed with a 500. Map it to the same 422 invalid_request, naming end_at.

* fix(gateway): name run_at in UTC overflow errors

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-21 19:41:46 +08:00
dependabot[bot]
702dd69c50
chore(deps): bump opentelemetry-api from 1.45.1 to 1.45.2 in /backend (#8473)
Bumps [opentelemetry-api](https://github.com/open-telemetry/opentelemetry-python) from 1.45.1 to 1.45.2.
- [Release notes](https://github.com/open-telemetry/opentelemetry-python/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-python/compare/v1.45.1...v1.45.2)

---
updated-dependencies:
- dependency-name: opentelemetry-api
  dependency-version: 1.45.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-21 19:37:50 +08:00
Hyeonsang Cho
2c98fe40d4
fix(channels): keep code blocks rendering across Discord message splits (#8384)
* fix(channels): keep code blocks rendering across Discord message splits

DiscordChannel._split_text cut a long reply at the last line break within
2000 characters without looking at code fences. A block cut in two left
the first message with an unclosed fence and the second with bare code,
so neither rendered as code and the code was read as markdown.

Track the open fence while splitting. A message cut inside a block now
ends with a closing fence and the next one reopens it with the same
opening line, indent included, with room for both reserved in the 2000
characters. Fence parsing follows CommonMark: a shorter or different run
does not close a block, and a backtick info string cannot hold a
backtick. A block opening on a message's last line moves to the next
message, and a fence line too long to repeat is split as plain text.

* fix(channels): read Discord code blocks the way Discord renders them

The split tracked CommonMark fences, but Discord's client closes a block at
the next three backticks, also right after the last code on a line, has no
tilde fences and no nesting. A block closed inline was taken as still open,
so the prose after it was reopened as code in every later message.

The reply is now parsed once with Discord's code-block rule, since which run
closes a block can depend on text past the split. Inside a block the split
takes the latest line end or closing run where both the closed and the
reopened block keep code, and a cut inside a line no longer splits a
backtick run or an escape.

* fix(channels): keep a Discord block's opener whole and read CRLF line breaks

When no line break fits, the split falls back to a hard cut, and that cut
could land in a block's opening run or language tag, or before its first
code: the message ended with "```p" and the next one reopened the block
with "ython" as its first code line. A hard cut that leaves this message
no code of the block now ends the message before the opening run instead,
so the block moves to the next message whole.

Discord's parser turns CRLF and a lone CR into LF before it reads code
blocks, but the splitter required LF after the language tag, so a long
CRLF block reopened with a bare fence. The block patterns now accept
either line ending, the empty-block checks strip CR too, and a cut inside
a line no longer separates CR from LF.
2026-11-21 19:13:17 +08:00
Nan Gao
7810b807f2
fix(skills): validate directory names and package regular files (#8444)
* fix(skills): constrain skill creation and packaging paths

* fix(skills): report creator and packager errors on stderr

* test(skills): expect packager validation errors on stderr

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-21 19:03:16 +08:00
Hyeonsang Cho
d834188dcd
fix(memory): rebuild the DeerMem index from the memory buckets only (#8463)
The full retrieval-index rebuild at Gateway startup globbed
`**/facts/**/*.md` under the storage root. The host's default root is the
runtime home, which also holds every thread's sandbox-writable workspace
(users/{id}/threads/{thread}/user-data/workspace). A fact-shaped file a
sandbox wrote at .../workspace/agents/{agent}/facts/ passed validation and
was indexed into that user's scope: memory_search served it, it never
appeared in the canonical memory, delete_fact left the row, and every
restart indexed it again. Any other workspace file below a facts/
directory logged a parse traceback and counted as a failed fact.

Walk only the fact directories the scoped readers use: the legacy root
bucket (agents/*/facts) and each user bucket (users/*/agents/*/facts).
2026-11-21 19:01:55 +08:00
yetuge
6b1680c8da
test(goal): skip the shared-handoff case on non-POSIX hosts (#8462)
present_shared_artifact answers 'requires POSIX' on a native Windows host, so
the shared-artifact delivery case fails there while the sibling
test_shared_artifact_handoff.py already skips non-POSIX. Guard the helper so
every shared-handoff caller skips on Windows; POSIX runs are unchanged.
2026-11-21 19:00:22 +08:00
哈基米
088189683c
fix(mcp): redact inline base64 payloads from tool error messages (#8412)
* fix(mcp): redact inline base64 payloads from tool error messages (#8326)

* fix(mcp): redact base64url payloads and update the guide

* fix(mcp): bound the data-URI params window

The data: branch rescanned a comma-free run from every start position, so a
crafted multi-MB error string cost quadratic CPU on the redaction path. Bound
the params window to 200 characters (MIME types and parameters sit well below
that) and cover the pathological input with a regression test.

* docs(mcp): explain the bounded data-URI params window
2026-11-21 18:57:48 +08:00
kongxin
9e85b2f367
fix(sharing): keep imported share history out of the importer's memory (#8422)
* fix(sharing): keep imported share history out of the importer's memory

Share import now marks every copied message with a server-owned
deerflow_imported_history key. Memory capture skips marked messages
after each run and in the pre-compaction flush, before any backend sees
them, so the sharer's statements no longer become facts about the
visitor. The Gateway strips the key from client input.

* fix(sharing): mark the copied history of copies imported before marks

Run admission now marks a share copy made before imported messages were
marked, next to the existing history-seed shim. Only messages from the
copy's root checkpoint, which the import wrote, are marked, so the
owner's own turns stay eligible for memory. Busy or paused threads are
left for a later run, and a metadata failure never blocks the run.
The share-import metadata keys are now server-reserved.
2026-11-21 16:46:09 +08:00
Nan Gao
317ced8030
fix(video-generation): follow same-origin MiniMax API redirects (#8458) 2026-11-21 16:43:42 +08:00
一片一片
db55b1322f
feat(extensions): add a run postmortem example over sealed evidence (#8411)
* feat(extensions): add a run postmortem example over sealed evidence

One sealed run's evidence becomes a verdict, an anomaly list, a bounded
timeline and a shareable Markdown document that answers "what happened,
and what should I check next?" — the question the event store can already
answer but nothing renders for an operator.

The example uses only the public extension API: CompletedRunEvidenceReader
through ExtensionRuntimeDeps, the request-scoped visibility reader when the
host offers one, and the snapshot owner as the second caller binding. Reads
follow the host cursor with a repeated-cursor guard and stop at max_events;
partial seals, truncated payloads and short reads surface as anomalies and
caveats rather than silently shrinking the report. postmortem.py is pure,
so the interpretation is unit-testable without a host.

* fix(extensions): separate read bounds from evidence damage in the postmortem

A short read caused by the caller's max_events claimed payload truncation,
which an operator reads as retention damage. Split the report: bounded
reads say so and add a caveat, an unexplained short read is
evidence_incomplete, and only host-truncated payloads are
evidence_truncated.

Also drop the bare "Error " tool-failure prefix (prose like "Error
handling in this tool ..." is not a failure), remove the unused
snapshot() helper, and cover the request-scoped visibility reader branch:
an invisible run is refused before any evidence is read.

* fix(frontend): list the run-postmortem example in the extension catalog

The catalog test compares the frontend catalog with the bundled example
directories, so a new example must appear in the directory, the locale
copy, and the key union. It is a backend-only extension: no namespace,
and its copy comes from the generated bundled documentation.
2026-11-21 16:36:22 +08:00
dependabot[bot]
8f1a6cddf9
chore(deps): bump wcmatch from 10.1 to 11.2 in /backend (#8464)
Bumps [wcmatch](https://github.com/facelessuser/wcmatch) from 10.1 to 11.2.
- [Release notes](https://github.com/facelessuser/wcmatch/releases)
- [Commits](https://github.com/facelessuser/wcmatch/compare/10.1...11.2)

---
updated-dependencies:
- dependency-name: wcmatch
  dependency-version: '11.2'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-21 16:00:46 +08:00
Nan Gao
57cc925e5b
fix(skills): review package text regardless of filename (#8445)
* fix(skills): review package text regardless of filename

* test(skills): cover binary markers after long text prefixes

* fix(skills): verify inferred operations and preflight model review budgets
2026-11-21 15:37:25 +08:00
ZephyrWang
2abcfa4250
fix(sandbox): honor data directories in explicit search globs (#8408) 2026-11-21 15:37:07 +08:00
Nan Gao
40ef4f6ac1
fix(web_fetch): validate URLs before calling hosted readers (#8447)
* fix(web_fetch): validate URLs before calling hosted readers

* fix(web_fetch): apply the URL check to all hosted readers

* fix(web_fetch): preserve bracketed query parameters
2026-11-21 11:41:57 +08:00
PeaceMaker-best
b41bd8b2ec
fix(models): share rate-limit cooldowns within quota groups (#8427)
* fix(models): share rate-limit cooldowns within quota groups

Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>

* docs(models): clarify request admission polling

Signed-off-by: Willem Jiang <willem.jiang@gmail.com>

---------

Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Signed-off-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-21 11:40:44 +08:00
Xinmin Zeng
9337f5b032
ci(tests): skip backend and frontend jobs that a pull request cannot affect (#8435)
* ci(tests): skip backend and frontend jobs that a pull request cannot affect

Every pull request ran all six backend shards and the frontend unit and lint
jobs, whatever it changed. A shared `changes` job now runs
scripts/ci_changed_scopes.py on the PR merge commit and gates the backend
(unit shards, default-install collection, lint-backend) and frontend
(unit tests, lint-frontend) jobs on the scope the diff touches.

The rules follow what each suite actually reads, measured by running the six
CI shards under strace: backend tests read files across the whole repository,
so the backend scope only skips frontend sources, tests and assets that no
backend test opens; frontend tests read contracts/, examples/, skills/public/
and the backend capability catalog, so those join the frontend scope. Pushes,
changes under .github/ and an unknown diff run every scope.
test_ci_changed_scopes.py runs the real script on a PR-shaped merge commit,
pins the workflow wiring, and fails when either side starts reading a path
outside its scope. lint-check also cancels superseded runs.

* ci(tests): check frontend reads on every PR and fail open on undecodable diffs

The guard that frontend code reads no path outside the frontend scope ran in
the backend shards, so a frontend-only PR that adds such a read skipped it.
The scanner now lives in scripts/ci_changed_scopes.py behind
--check-frontend-reads, and an ungated frontend-scope-reads job in
lint-check.yml runs it on every pull request.

The scanner also reads frontend/Makefile and package.json, which found that
`make test` runs pnpm through scripts/pnpm.py; that launcher joins the
frontend scope.

`git diff -z` prints raw path bytes, so a non-UTF-8 path raised
UnicodeDecodeError and the changes job wrote no outputs, skipping every gated
job. An undecodable diff is now an unknown diff and runs every scope.

* ci(tests): follow URL and pathlib references in scope guards

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-21 11:40:08 +08:00
dependabot[bot]
62b7009f5e
chore(deps): bump next from 16.4.1 to 16.4.5 in /frontend (#8455)
Bumps [next](https://github.com/vercel/next.js) from 16.4.1 to 16.4.5.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.4.1...v16.4.5)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 16.4.5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-21 10:59:28 +08:00
Nan Gao
7afb749992
fix(video-generation): validate provider download URLs (#8446)
* fix(video-generation): restrict provider download destinations

* docs(video-generation): clarify shared MiniMax download hosts
2026-11-21 10:52:07 +08:00
yetuge
6499631484
fix(runtime): enforce artifact delivery only for goal runs (#8410)
* fix(runtime): enforce artifact delivery only for goal runs

Since #4494 an ordinary run that left a working file or a local copy under
outputs ended as error although the task was finished. Record the verdict as
enforcement=required only for a run that took part in a goal (participation is
recorded before the evaluation write, so a failed verdict write cannot
downgrade it), and keep the ordinary verdict advisory so the receipt and
workspace changes stay visible without failing the run. Hidden paths were
handled in #8254.

* fix(runtime): keep delivery required when the goal read is unavailable

read_thread_goal swallowed every exception and returned None exactly like an
absent goal, so a transient checkpoint-read failure on an interactive goal
thread downgraded delivery to advisory while the goal stayed active. Retry the
read once, then treat an unreadable goal as unknown and mark participation, so
delivery stays required.

* docs(runtime): include the unknown-goal trigger in the enforcement list
2026-11-21 10:49:37 +08:00
ordinary being
cd518c347b
fix(runtime): keep replayed fallback from failing a successful run (#8324)
* fix(runtime): scope fallback detection when pre-run capture fails

A failed pre-run snapshot capture leaves the message-id boundary empty, but values-mode chunks still replay prior history. A stale deerflow_error_fallback marker can therefore flip a successful current run to error. When capture failed, attribute only the newest values message to this run; incremental modes and journal fallback detection stay unchanged. Parametrize the stale-history regression over capture success and failure.

* fix(runtime): establish fallback boundary on uncaptured values frames

An initial values frame can be entirely replayed history, so latching its newest fallback still misclassifies the run. When the pre-run snapshot was not captured, record the first values frame as the message-ID baseline and accept only later IDs; only then can a fallback be attributed to the current run. Update the regression to emit the initial replay frame, and keep the fresh-fallback control with an empty initial frame.

* test(runtime): cover replay boundaries in both values modes

Emit the initial replayed values frame as a separate frame and assert both values-only and values+updates streams ignore its stale fallback. Keep the fresh-fallback control on the same two mode shapes.

* fix(runtime): keep no-checkpointer runs as current fallback sources

An in-memory run has no replayed history, so a values frame is current even when snapshot capture is unavailable. Only a thread with a checkpointer needs the first-frame replay baseline; preserve fallback detection for checkpointer-less runs.

* fix(runtime): filter replayed fallbacks from updates frames too

ThreadDataMiddleware.before_agent returns full history in an updates frame. When the pre-run snapshot capture failed, the message-ID boundary now covers values and updates frames and collects nested update messages; values and updates-only requests skip replayed fallback markers while fresh updates remain eligible. Add a regression that builds the history update with the real middleware and covers updates-only and values+updates.

* fix(runtime): bound fallback on empty frames and checkpoint streams

Set the replay boundary on the first values or updates frame even when it has no messages, so a new thread's first fallback is not mistaken for history. Treat checkpoints and debug snapshots as replay sources: they seed the message-ID boundary and never latch a fallback. Add regressions for empty boundary frames in values, updates and mixed mode, and for checkpoints/debug history before values.

---------

Co-authored-by: Tong-bit-art <Tong-bit-art@users.noreply.github.com>
2026-11-21 10:37:34 +08:00
paer
ec2c881c6b
fix(tui): handle closed pipes when flushing short --print answers (#8388)
* fix(tui): flush short headless answers before exiting

* test(tui): expose the broken-pipe exit status on regression
2026-11-21 10:34:47 +08:00
Harvey DU
477c8e04ec
fix(feishu): keep a card's markdown image from failing every update (#8423)
* fix(feishu): keep a card's markdown image from failing every update

A card markdown element only renders a markdown image whose target is an
uploaded `image_key`. An answer that carries `![alt](url)` therefore made Feishu
reject the card with 230099 / 11310 ("the card contains images but no imagekey is
passed in"), and because the same card is patched for each streamed snapshot,
every later update failed too: the reply stopped at the text sent before the
image marker (#8407).

Rewrite the marker as a link before the card is built, which keeps the
reference and its target in a form the element renders. Fenced blocks and
inline code spans stay literal, since a card shows them as code and rewriting
what they contain would misreport the answer.

The rewrite only removes a character, so a card that already fit Feishu's
30 KB body limit still does.

* fix(feishu): rewrite the button card's text and stay literal in an open fence

Review follow-ups on the card markdown rewrite.

The clarification button card builds its own JSON and is delivered with
`raw_card_content=True`, so it never passed through `_build_card_content`: an
agent-authored question carrying `![alt](url)` would still be rejected with
230099 / 11310. `build_button_card` now applies the same rewrite to the text it
puts in its markdown element (imported inside the function, since feishu.py
imports that module).

A snapshot streamed before its closing fence arrives has an open block at the
end, and the closed-fence pattern did not see it, so a marker inside that block
was rewritten in the transient snapshot and then shown as a link in what had
been code. What follows an unterminated opener is now left literal.
2026-11-21 10:33:03 +08:00
Hyeonsang Cho
8a6eb9c898
fix(middlewares): keep queued hints when an empty model response is retried (#8424)
* fix(middlewares): keep queued hints when an empty model response is retried

LoopDetection, TokenBudget, ToolProgress and Todo take their queued hint out
of the run's queue in wrap_model_call and put it back only when the call
raises. A completed call with no content returns normally;
LLMErrorHandlingMiddleware, which sits outside them, then turns it into
EmptyModelResponseError and retries by running the inner wraps again. The
queue was already empty, so the retry went out without the hint. Loop and
TokenBudget had already marked the run as warned, so that run never saw the
warning.

Each wrap now puts its hints back on an empty stop response too, using the
same check LLMErrorHandlingMiddleware retries on
(model_response.is_empty_stop_response). Test fakes that returned a MagicMock
or a string as the model's answer now return an AIMessage, since the check
reads anything else as no answer, as LLMErrorHandlingMiddleware does.

* docs(middlewares): note that a model retry runs the inner wraps again

LLM error handling retries both a call that raised and an empty stop response by calling the inner wraps again, so a wrap that takes a queued hint for one call must put it back in both cases.
2026-11-21 10:31:13 +08:00
thzon
6addd93d32
docs: clarify how to open the workspace after deployment (#8442)
* docs: clarify how to open the workspace after deployment

* docs: clarify local workspace entry
2026-11-21 10:26:51 +08:00
PeaceMaker-best
1bd99c5adb
fix(models): retain native DeepSeek cache-hit usage (#8428)
Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Co-authored-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
2026-11-21 10:24:42 +08:00
Bas Cancrinus
715d50851f
feat(opensandbox): allow OpenSandbox SDK 1.x (#8403)
SDK 0.1.x doesn't send OPEN-SANDBOX-API-KEY on execd calls routed through
the server proxy (use_server_proxy: true); from 1.1.0 on the SDK attaches
the key to those calls in proxy mode and still never in direct mode.

Raise the harness extra to opensandbox>=1.1.0,<2.0.0 (lock: 0.1.15 ->
1.2.1, no other package changes). Every SDK call the provider makes keeps
its signature in 1.x. Update the install hint, the packaging test and the
README note on append, which 1.x doesn't provide either.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 09:35:36 +08:00
Totoro
c4ba921143
feat(mcp): add per-user browser OAuth for remote servers (#8425)
* feat(mcp): add per-user browser OAuth for remote servers

* fix(mcp): let users clear grants after server removal

---------

Co-authored-by: Totoro-qaq <279883115+Totoro-qaq@users.noreply.github.com>
2026-11-21 09:32:32 +08:00
yetuge
271f6e9ad4
fix(agents): make the todo completion reminder match the guard's terminal statuses (#8432)
* fix(agents): make the todo completion reminder match the guard's terminal statuses

The reminder told the model to finish everything and only mark items
completed, while the guard also accepts blocked and waiting. A step that
cannot continue in this run was retried or falsely marked completed to get
past the guard. Offer blocked/waiting and name the same terminal set the exit
check uses.

* test(agents): state that the reminder test checks the instruction, not the response

* fix(agents): include the completion reminder template in the assembly fingerprint

The fixed reminder is model-visible instruction text, but release_policy_parameters
hashed only the system prompt and tool description, so a wording change left
AgentAssemblyDescriptor.fingerprint unchanged. Hash the template rendered with
an empty item list, keeping per-run todo content out.

---------

Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-21 00:53:33 +08:00
Xinmin Zeng
e3edd05114
test: prune 76 redundant, dead, and source-grep test suites (#8433) 2026-11-20 20:25:42 +08:00
leom1919
92d884b6d7
docs: fix dead link to removed LangGraph middleware concept page (#8434)
langchain-ai.github.io/langgraph/concepts/middleware/ has been removed
(the concepts/ section no longer lists middleware); the content now lives
under docs.langchain.com. Point both references at the unified middleware
overview page.
2026-11-20 18:12:33 +08:00
Houston
8113420c8f
fix(title-middleware): wait for the first complete exchange to generate a title (#8338)
* fix(agents): wait for the first complete exchange to generate a title

* fix(agents): preserve default title timing in the SSE stream

* fix(title-middleware): generate model titles at turn end

* fix(title-middleware): preserve titles across live input and recursion caps

* fix(runtime): recover first-turn titles from delta checkpoints

---------

Co-authored-by: Houston <347629597+HoustonJia@users.noreply.github.com>
Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-20 13:11:56 +08:00
Xinmin Zeng
5bb4da91ea
ci(tests): isolate offline benchmark suites into path-triggered workflow (#8414) 2026-11-20 10:27:23 +08:00
Hyeonsang Cho
a0c3968f28
fix(channels): publish failed-run replies before releasing the dedupe key (#8383)
* fix(channels): publish failed-run replies before releasing the dedupe key

The generic error handler, both thread-busy replies and the /wait
stale-pin recovery released the inbound dedupe key before publishing
their reply. Publishing awaits the channel's send, so a provider
redelivery could start over on another worker while that reply was
still on its way. Publish first, then release, as the step-limit,
fire-and-forget stale-pin and streaming paths already do.

* fix(channels): release the dedupe key when shutdown cancels a failure reply

The release decision is made from the run's own failure before the reply,
and a reply that is cancelled or raises still releases the key, so shutdown
no longer turns a rejected run into a key kept for the dedupe TTL. A /wait
read timeout still keeps the key. The ordering tests wait for inbound
completion and always stop the manager.
2026-11-20 10:13:20 +08:00
Xinmin Zeng
047805137f
test(backend): prune 3 AST-mutation and bug-revert verified redundant suites (#8413) 2026-11-20 10:08:46 +08:00
yetuge
0ed5743832
fix(gateway): reject unusable artifact state at the input boundary (#8409)
artifacts and tool_artifact_processed are caller-writable reducer channels
whose values the thread-state route persists with Overwrite. A non-list value
was stored before any reducer saw it, and the next artifact-producing run
failed on existing + new; unhashable entries crashed the dedupe. Validate the
declared list-of-strings shape on both boundaries and let merge_artifacts
ignore a non-list side or non-string entry so an already-poisoned checkpoint
heals instead of failing every later run.
2026-11-20 06:51:27 +08:00
golemon
018a8d814d
fix(sandbox): derive bash tool status from process exit codes (#8396)
* fix(sandbox): derive bash tool status from process exit codes

Carry native exit codes in string-compatible command output and stamp bash tool results before content-based normalization. Preserve redaction, truncation, timeout markers, scoped execution, and legacy provider string returns.

Add real subprocess and graph regressions for error-like stdout, JSON data, forged exit markers, redaction, nonzero exits, timeouts, and result copying. Validate sync and async execution with tool progress enabled and disabled.

* docs(sandbox): explain local bash execution status

Document that native bash status follows the exit code while error-like output remains command data. Clarify that redaction and output limits do not change execution status.

* fix(sandbox): include provider exit codes in bash metadata

Carry numeric process exit codes in producer-stamped bash tool results. Extend the progress metadata schema and regression coverage so the additional field preserves progress tracking and graph receipts.

* fix(subagents): prefer provider exit codes for test evidence

Use validated producer exit codes before output markers when harvesting bash execution evidence. Preserve text fallback for legacy results and malformed metadata without weakening test-summary acceptance.

Cover real pytest reporter conflicts, checkpoint round trips, failure and unverified summaries, and legacy metadata. Document the exit-code precedence and compatibility behavior.
2026-11-20 06:49:21 +08:00
Zeren Wang
a96c9c0318
fix(skills): make find-skills installer failures actionable (#8393)
* fix(skills): make find-skills installer failures actionable

* fix(skills): clarify installer guidance and harden tests

* docs(skills): correct installer usage header
2026-11-20 06:27:56 +08:00
Wenchao An
50d04ddf71
feat(coordination): run tasks on managed worker threads (#8387)
* feat(coordination): run tasks on managed worker threads

* fix(coordination): expose task artifact history

* test(boxd): make partial timeout output check deterministic

* fix(coordination): expose task inbox and bound cancellation waits
2026-11-20 06:26:29 +08:00
Bas Cancrinus
b4b489d7f2
feat(helm): optional per-image tags for gateway, frontend and provisioner (#8337)
* feat(helm): optional per-image tags for gateway, frontend and provisioner

All three DeerFlow images take `image.tag`. A backend rebuilt on top of a
release (extra packages such as an optional sandbox SDK, a local fix) needs
its own tag, so the frontend and provisioner then need re-tagged copies of
the release under that tag.

Add `image.gatewayTag`, `image.frontendTag` and `image.provisionerTag`,
empty by default; an empty one falls back to `image.tag`, so existing
values render unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(helm): fail the render on a non-string per-image tag

`--set image.gatewayTag=20261118` passes an integer: printf rendered the
image as `deer-flow-backend:%!s(int64=20261118)`, and `default` silently
replaced an integer 0 with `image.tag`. A shared `deer-flow.imageTag`
helper now fails the render on any non-string override and names
--set-string; README and values.yaml say to quote numeric tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(helm): check the per-image tag's type, not its kind

Helm 3.18.0 passes an unquoted number from a parent chart's values to the
subchart as a json.Number, whose kind is "string", so kindIs let 7.0 and
0123 through and they rendered as 7 and 83. typeIs rejects them; quoted
tags still render as written. The error now names the Go type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:28:40 +08:00
kongxin
5991ab936e
fix(runtime): keep an edit replay that pauses for tool approval (#8390)
The edit replay finalizer rolled back every run that did not end in
success, including one waiting for tool approval. The edit was lost, the
resume had nothing to run, and the unanswered interrupt kept blocking new
runs on the thread.

Treat a native pause as the current attempt: skip the rollback and let the
paused attempt replace its source turn in history.
2026-11-19 21:26:58 +08:00
Xinmin Zeng
dab27449b3
perf(tests): eliminate 140s of idle waits and SIGTERM grace timeouts across 7 slow suites (#8374)
* perf(tests): eliminate 140s of idle waits and SIGTERM grace timeouts across 7 slow suites

* test(backend): address review feedback on heartbeat sync, container cleanup, and deadline patch

* test(backend): observe artifact deadline extension at transfer

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-19 20:16:16 +08:00
Xinmin Zeng
3b1578fd91
test(backend): consolidate 57 fragmented single-fix files into 8 module suites (#8372)
* test(backend): consolidate 57 fragmented single-fix files into 8 module suites

* chore(tests): update benchmark README command and remap 603 shard durations

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-19 20:05:04 +08:00
一片一片
585abb979f
fix(gateway): reject unusable delegation state at the input boundary (#8375)
* fix(gateway): reject unusable delegation state at the input boundary

`delegations` is a caller-writable reducer channel. `merge_delegations`
keys on `id`/`run_id`/`dispatch_message_id` and indexes `status`, and the
ledger renderer indexes `description`/`subagent_type` on every model
call, so a non-list value, a non-object entry or a missing field fails
the state merge with an unhandled 500. On the thread-state route the bad
shape is persisted, so every later genuine ledger write keeps failing.

Validate the ledger shape at both caller-writable boundaries and keep
rejecting Overwrite markers and forged verdicts. The reducer also drops
stored values it cannot read, so a checkpoint written before this
validation self-heals instead of failing future writes.

* fix(harness): keep the ledger reducer tolerant of partial entries

The reducer only needs an identity key and a status; the renderer-only
text fields stay a boundary requirement. Dropping entries that lack
description/subagent_type would change reducer semantics for callers
that build minimal entries, so filter only what the reducer reads.

* test(gateway): use valid delegation in provenance check

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-19 11:40:37 +08:00
哈基米
90ca57e97b
fix(mcp): report non-text error results without their payload (#8327)
* fix(mcp): report non-text error results without their payload

When an MCP tool returns isError with no text content, the local conversion
fell back to stringifying the LangChain content blocks. That put the whole
base64 payload into the ToolException message, and the middleware's
500-character cap still left a base64 prefix in the model-visible ToolMessage
and the checkpoint.

Describe the blocks by kind and MIME type instead; text results keep their
existing message unchanged. Applies to stdio tools, which use this conversion;
sse/http tools keep the adapter's conversion (tracked separately).

* fix(mcp): name empty binary error payloads instead of raising

An error result whose embedded file or image had a zero-byte payload hit
create_file_block/create_image_block before the isError branch, so the
model saw ValueError('Must provide one of: url, base64, or file_id')
instead of the server's diagnostic. Skip empty binary payloads on error
results, name their shape in the no-text fallback, and keep normal
results unchanged (audio still raises NotImplementedError).
2026-11-19 11:38:39 +08:00
Bas Cancrinus
c9ecf577c4
fix(helm): drop rollingUpdate when a Deployment strategy is Recreate (#8336)
* fix(helm): drop rollingUpdate when a Deployment strategy is Recreate

The gateway and provisioner default to RollingUpdate with a rollingUpdate
block. Setting only `strategy.type: Recreate` renders both, which the API
server rejects ("may not be specified when strategy type is 'Recreate'").
A direct install can null the block, but a parent chart that depends on
this chart can't: Helm keeps the subchart's default. A single gateway on a
ReadWriteOnce home PVC needs Recreate, since the new Pod can't attach the
volume on another node while the old one holds it.

A `deer-flow.strategy` helper renders the strategy and drops rollingUpdate
for Recreate; both Deployments use it. Defaults render unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(helm): note the Helm 4 server-side apply case when switching to Recreate

A release whose manifest omitted strategy leaves the API-server-defaulted
rollingUpdate unowned; server-side apply then can't remove it and the
switch to Recreate is rejected. Document running that upgrade with
--server-side=false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 08:10:45 +08:00
Eilen Shin
25a744a99a
fix(harness): reflect progress in loop detection and plan todos (#8248)
* feat(frontend): improve file attachment recovery and artifact presentation

* feat(extensions): add Office artifact previews with search and navigation

* fix: preserve public viewers and HTTP Office previews

* fix: address file preview and upload review findings

* fix: use typed upload errors and linear bookmark allocation

* fix(office-preview): isolate parsing and bound preview resources

* fix(ci): install Office preview fixture dependencies for E2E

* fix(ci): provision matching Playwright browsers before E2E tests

* fix(ci): isolate Python libraries and include Office documentation

* test(frontend): wait for download status to finish rendering

* fix(harness): account for tool results in loop detection

* fix(harness): make tool frequency detection observational

* fix(harness): support blocked and waiting plan todos

* style(harness): wrap overlong system prompt lines

* Improve loop detection and todo message formatting

Refactor middleware logic for handling repeated results and update messages for todo list.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Address plan progress and loop detection review

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-19 08:09:43 +08:00