Commit Graph
13285 Commits
Author SHA1 Message Date
Charles YaoandClaude Opus 4.8 aa4e49df23 feat(dify-builder): add non-reactive trace ring buffer
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 02:50:17 -07:00
Charles YaoandClaude Opus 4.8 31a972e961 Merge PR #41778 (feat/add-progress-event) into feat/dify-builder
Integrates the FE team's live-progress + conversation-streaming rework
(durable progress events, repository layer, snapshot-consistent reads,
idempotent message retries, EDIT_PUBLISH->EDIT_COMPLETE) and reconciles its
interrupted-step recovery model with the reconciler already on
feat/dify-builder.

Combined recovery model:
- interrupted (crash mid working-step, lock released, nothing durably
  recorded) -> Retry (recovery_continue, re-runs the handler) + Start over
- FAILED (handler raised, recorded by runner.fail) -> Restart only
- a Retry that itself raises lands in FAILED -> Restart (no wedge)

Kept from the PR: EDIT_PUBLISH working / EDIT_COMPLETE terminal, snapshot
refresh in apply_recovery_action, paused reset. Kept from the reconciler:
Retry on interrupted, state-aware access tier (EDIT_PUBLISH added to the
publish tier), apply_repair idempotency filter.

680 dify_builder unit tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 02:14:40 -07:00
twwu 0db923c6cc feat(dify-builder): align conversation cards with design 2026-09-04 16:10:32 +08:00
twwu ac7db51302 fix(dify-builder): align form schema types with values 2026-09-04 16:10:22 +08:00
Charles YaoandClaude Opus 4.8 3fec0e9458 fix(dify_builder): gate interrupted-step Retry at the working op's access tier
A recovery_continue (Retry) re-runs the interrupted working handler, which
re-invokes the state's privileged op -- publish (RELEASE) at build.publish/
fix.publish, a draft test run (TEST_AND_RUN) at the test/verify states. Before
this, recovery_continue was classified as base EDIT, so a Retry re-ran the
privileged op below its own authorization tier without re-checking. Make
_app_access_for_action state-aware for recovery_continue so it enforces the
same tier the state's normal action requires. recovery_restart only resets +
re-enters the entry state, so it stays EDIT.

Also: an interrupted working step now always surfaces the Retry/Start-over
offer, overriding a stale drift recovery_class a user may have left set at an
earlier waiting gate (drift recovery only applies at a waiting gate).

Addresses the two findings from the final reconciliation review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 00:18:17 -07:00
Charles YaoandClaude Opus 4.8 f623dc3fe1 feat(dify_builder): recover an interrupted working step via Retry/Start over
When a session crashes mid working-step (e.g. build.publish; the async advance
raised and released the lock), it was a locked dead-end: working states surface
no UI actions and the composer locked with no way forward.

- Surface a RecoveryRef offer (can_continue=Retry, can_restart=Start over,
  recovery_class="") on an interrupted working-state view -- built directly so a
  real drift class still wins.
- Allow recovery_continue / recovery_restart at an interrupted working state in
  _internal_action_allowed. recovery_continue returns the working state
  (non-settled) so the runner re-runs the stalled handler; recovery_restart
  resets working fields and re-enters the entry state -- both reuse existing
  recovery machinery, no new action kinds / no runner change.

Adds unit tests (offer surfaced, allowance) + regression tests (recovery_continue
re-runs handle_publish and advances; recovery_restart resets to entry state;
repeat-failure re-surfaces the offer with no wedge).

This reconciler was reviewed as a standalone plan on the pre-merge base; here it
is re-applied onto feat/dify-builder after PR #41677 merged in the reworked
service.py + _internal_action_allowed gate (which makes the allowance necessary).
The apply_repair idempotency + delete-guard commits (safe fix.apply Retry) land
alongside it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 00:07:14 -07:00
Charles YaoandClaude Opus 4.8 3dcb06db01 fix(dify-builder): exclude in-batch delete_node ids from apply_repair idempotency filter
apply_repair's already-present filter (added for interrupted-step Retry
idempotency) compared create_node/connect intents against before_graph
alone, with no awareness of delete_node intents in the same batch. A
from-scratch build sends delete_node(placeholder_start) + create_node(same
id) in one apply_repair call to replace the canvas's default placeholder
start with the generator's own start node -- the filter dropped the
create_node as "already present" while the delete_node still ran, deleting
the start node with no re-create, so the following connect raised
ValueError: node not found. Mirror handlers_build.py's existing M2 guard:
subtract in-batch delete_node targets from the present-node/edge sets
before filtering, so a delete+recreate of the same id in one batch survives.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 00:01:42 -07:00
Charles YaoandClaude Opus 4.8 61b35a36b7 fix(dify_builder): make apply_repair idempotent for already-present create/connect
Drops create_node intents whose id already exists and connect intents whose
edge already exists (referenced against the original draft graph), so a
fix.apply Retry re-applying the same intents is a clean no-op instead of a
duplicate/ValueError. graph_ops validation (raise on a genuinely fresh
duplicate id) is preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-04 00:01:42 -07:00
twwu efa7528275 fix(web): simplify builder conversation events 2026-09-04 14:40:50 +08:00
twwu 4893c5e621 refactor(dify-builder): separate reasoning from execution progress 2026-09-04 13:43:16 +08:00
twwu eb25c2d8ee feat(dify-builder): add live progress and conversation streaming 2026-09-04 10:16:50 +08:00
twwu 537d2a3178 Merge branch 'main' into feat/dify-builder 2026-09-04 09:44:01 +08:00
Sourav Rajvi df0460f876 fix(binding-files): keep UTF-8 text preview when max_bytes splits a character (#41761) 2026-09-04 01:35:32 +00:00
yyh 65b4091402 refactor(query): migrate imperative APIs to query semantics (#41746) 2026-09-03 13:54:48 +00:00
Keith e6a38fd793 refactor(models): remove legacy db.session property wrappers on Document (#41721) 2026-09-03 13:34:49 +00:00
非法操作 8c98e3fad5 refactor(web): align account preference requests with API contracts (#41748) 2026-09-03 12:55:44 +00:00
非法操作 24f9f07752 fix(web): map pt-BR to pt_BR for tool metadata (#41745) 2026-09-03 12:54:46 +00:00
yyhandJoel 4beffa97e0 refactor(web): migrate runtime variable inputs (#41739)
Co-authored-by: Joel <iamjoel007@gmail.com>
2026-09-03 09:38:39 +00:00
Joelandyyh aee0062cb2 chore: remove redundant aria-label attributes (#41724)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
2026-09-03 09:10:16 +00:00
yyh 863930836b chore(dify-ui): enable purity lint in tests (#41736) 2026-09-03 09:00:30 +00:00
zyssyz123 a702b3bb2b fix(agent): surface missing tool credentials (#41726) 2026-09-03 08:53:55 +00:00
Byron.wangandautofix-ci[bot] 692010f0fc refactor(api): decouple console OAuth flow from legacy account services (#41188)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-03 08:47:14 +00:00
363753a0c5 chore(i18n): sync translations with en-US (#41733)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-09-03 08:46:49 +00:00
yyh e982a3de33 test(web): remove workspace switcher browser test (#41728) 2026-09-03 08:06:17 +00:00
Stephen Zhou 137eb19de9 chore(web): prune unused i18n keys (#41725) 2026-09-03 08:01:55 +00:00
Zhu Lei 612a929907 fix(web): stringify object editor values before Monaco createModel (#41719) 2026-09-03 07:51:41 +00:00
Stephen Zhou 29acaabc6a chore(web): canonicalize Tailwind classes (#41718) 2026-09-03 07:33:05 +00:00
Jingyi 642ad2fffe fix(web): align workspace switcher states and semantics (#41713) 2026-09-03 07:18:49 +00:00
Benjamin 8f7cca3ae2 fix(web): guard LLM node model_selector against persisted null (#41707) 2026-09-03 06:20:48 +00:00
Byron.wang b015aa416f refactor(api): extract account login service and consolidate adapters (#41184) 2026-09-03 06:20:21 +00:00
非法操作 ba1d5ba172 refactor(api): centralize remote file handling (#41627) 2026-09-03 06:00:13 +00:00
zyssyz123 688107c3e5 fix(api): bound suggested question generation latency (#41705) 2026-09-03 05:02:09 +00:00
非法操作 d8c3f7c5ee refactor(openapi): inject file upload service (#41606) 2026-09-03 04:42:31 +00:00
非法操作 69484a07e1 refactor(console): inject file service (#41603) 2026-09-03 04:42:30 +00:00
非法操作 5f4b1f867d refactor(web): inject file upload service (#41586) 2026-09-03 04:42:30 +00:00
Eddy ZHANG fc7193cf04 refactor(service_api): dep-inject the dataset create payload with @model_validate (#41651) 2026-09-03 03:52:41 +00:00
yyh 59021616d4 refactor(web): migrate legacy form controls to Dify UI (#41682) 2026-09-03 03:50:23 +00:00
非法操作 ab0e92b893 refactor(service-api): inject file upload service (#41585) 2026-09-03 03:41:45 +00:00
twwu c00852cf97 fix(api): linearize Dify Builder migration after main 2026-09-03 11:28:53 +08:00
Wu Tianwei b0b495d243 feat(web): make markdown form field name length configurable (#41697) 2026-09-03 03:21:10 +00:00
twwu a257ac4dee Merge branch 'main' into feat/dify-builder 2026-09-03 11:12:22 +08:00
yyh 6536ffc422 docs(web): clarify browser mode focus test boundary (#41692) 2026-09-03 02:48:08 +00:00
Stephen Zhou b7570ce4b7 chore(dify-ui): migrate class merging to cn (#41693) 2026-09-03 02:31:52 +00:00
dependabot[bot] 907bc2558b chore(deps): bump transformers from 5.5.0 to 5.10.1 in /api (#41609)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-03 01:50:39 +00:00
Eddy ZHANG 95a6a14ed5 refactor(console,web): dep-inject query params with @model_validate (#41646) 2026-09-03 01:50:22 +00:00
Byron.wangandautofix-ci[bot] be7d11ca1d refactor(api): extract forgot password application service (#41111)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-03 01:38:59 +00:00
twwu c5655ffe9d fix(web): optimize Dify Builder composer input 2026-09-03 08:48:23 +08:00
Charles YaoandClaude Opus 4.8 2b4df02305 fix(dify_builder): close SSE subscription even when the response is never iterated
progress_bus.subscribe() eagerly enters the pub/sub subscription (opening a
Redis connection + starting a listener thread) BEFORE the SSE generator
exists, so the subscribe completes before the Celery advance can publish.
But the only close() lived in the generator's finally -- which Python does
not run if the generator is never started. A streaming Response dropped
before its first frame (client aborted, or an after_request/teardown error)
therefore leaked the connection + thread until process restart.

stream_advance_frames now returns a small _ClosingFrameStream wrapper whose
close() closes the subscription directly (idempotent); the WSGI server calls
close() on the response iterable even on early disconnect, so cleanup fires
regardless of iteration. The inner generator keeps its own finally for the
iterated/disconnect paths, so this is strictly additive -- no happy-path
change. All seven call sites get it unchanged.

Adds a regression test (never-iterated stream -> close() -> subscription closed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 08:48:23 +08:00
Charles YaoandClaude Opus 4.8 de8a5745ea fix(dify_builder): always emit a terminal SSE frame so held version can't go stale
Two paths ended a streaming advance without a terminal `state`/`error`
frame, leaving the SSE client stalled to the deadline with a stale held
version -> its next action 409s:

1. advance_session published the terminal `state` frame outside the
   try/finally and unguarded. If the post-advance view projection
   (get_session_view -> read_graph) or the publish itself raised after a
   SUCCESSFUL advance, the exception escaped and no terminal frame was
   sent. Guard it and fall back to a terminal `error` frame.

2. submit_action_stream emitted a terminal `state` frame on settle only
   for `message`. `update_model` also settles synchronously while bumping
   the version, so it now emits one too -- otherwise the FE keeps the old
   version and 409s on its next action.

Adds regression tests for both (projection-failure -> error frame;
update_model -> state frame).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 08:48:23 +08:00
Charles YaoandClaude Opus 4.8 87b22412b6 ci: drop deleted gen-dify-builder-contract from autofix workflow
This branch removed the Dify Builder contract generator (contract_gen.py
and the gen-dify-builder-contract npm script), but autofix.yml still
invoked that script. On every api/** change the "Generate frontend
contracts" step failed (command not found under bash -e), turning the
job red and skipping the autofix-ci commit step -- so even the good
gen-api-contract output never landed. Remove the stale invocation and
the now-redundant contract_gen.py path-filter entries (already covered
by api/**).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 08:48:23 +08:00