Commit Graph
354 Commits
Author SHA1 Message Date
twwu d9991a11e1 Merge branch 'main' into feat/dify-builder 2026-09-21 15:23:36 +08:00
twwu d5ca5ea8ef fix(dify-builder): stream native test runs after canvas refresh
Run workflow streaming inside the Builder worker to avoid queue deadlocks. Forward native events to shared editor callbacks and wait for graph refresh before retesting repairs.

Keep command cleanup stable, preserve batched canvas events, and allow failed or unfinished historical runs to refresh again.
2026-09-21 15:12:22 +08:00
盐粒 Yanli 2a66bf6f09 refactor(workflow): prepare inputs by entry node type 🤖🤖🤖 (#42595) 2026-09-21 05:26:23 +00:00
Charles YaoandClaude Opus 5 a3c2e7fca5 feat(dify-builder): tell the canvas which run to show
Streaming the test run gives the user a live progress bar but no results:
NodeEvent carries node_id/title/status/error and nothing else, so a client
watching the stream learns which node is running, never what it produced.
The results already exist -- the run is a normal InvokeFrom.DEBUGGER draft
run, its node executions are in the database, and the editor's canvas
already knows how to render exactly that view. It was simply never told
which run to open.

So put the Dify run id where a client can reach it:

- NodeEvent gains run_id, filled from the streaming frame. Every non-ping
  frame is stamped with workflow_run_id, so this arrives with the FIRST
  node event -- while the run is still going, which is the point.
- The node SSE frame publishes it alongside the existing fields.
- mark_test_success / mark_test_error carry dify_run_id in both the Build
  and Edit flows, so the terminal state names its run too.

This is what makes per-node results land on the graph, where a node's
inputs and outputs already have a home, instead of only as a JSON blob on
a conversation card.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-20 17:16:41 -07:00
twwu cce9470161 Merge branch 'main' into feat/dify-builder 2026-09-20 09:45:05 +08:00
Asuka Minato ce5dc6f314 chore: add some type (#37173) 2026-09-19 09:26:15 +00:00
twwu bb7f7e4640 Merge branch 'main' into feat/dify-builder 2026-09-18 16:06:20 +08:00
Asuka Minato a504dfee27 ci: Update pyrefly dependency version to 1.3.0 (#42445) 2026-09-18 02:16:47 +00:00
Charles YaoandClaude Opus 5 65a47018b4 feat(dify-builder): say the app's name once when the build lands
Spec N4 has the build-complete card headline read "<App name> is ready", with
the annotation 名字只在回复句里念一次;记录卡上不出现 -- said once, in that
sentence, and never repeated on the completion receipt. We said it nowhere: the
card was titled "Build plan" and the engine had no app name to say.

DifyBuilderContext now carries app_name, seeded at session creation through a
get_app_name_fn seam alongside the existing revision/authorize ones. Env.rename_app
returns the name the database actually took rather than None, so the refine
records what landed instead of what it proposed -- the service normalizes after
the engine hands off, and the two can differ.

The headline is interpolated, so it gets a strings.py template or it would
survive localization untranslated. That pattern matches almost anything ending
in "is ready", so it sits last and every more specific template gets first
refusal.

The receipt already omitted the name; there is now a test pinning that.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 18:09:23 -07:00
Charles YaoandClaude Opus 5 aa2b4fe4ab feat(dify-builder): name apps from their prompt, and turn gate actions into card options
Two App Builder spec changes that share the Builder session contract.

Naming (spec N1-N3): an app created from the homepage prompt is no longer named
by the user. core/dify_builder/naming.py cuts the prompt's opening clause at
create time -- instant and infallible, since it runs inside POST /apps -- and
CreateAppPayload.name becomes optional alongside a new prompt field. The Builder
then refines that name once during goal analysis, where a model and the detected
reply language are already in hand, so the judgement calls that are
English-shaped in pure Python (dropping an imperative lead-in, spotting a
contentless prompt) work in any language. Plan approval freezes the name.

Card options: SessionView gains a Decision carrying the gate's choice as options
inside the card plus a fixed confirm/cancel pair, replacing a button row whose
shape changed at every state. Option ids are the old action ids untouched, so
resolve_action_kind and the per-state legality check are unchanged, and
SessionView.actions keeps being populated -- the deployed web client goes on
working until it reads decision instead.

The regenerated console OpenAPI doc also picks up ErrorCard.diagnostics, missed
when cc9ca8b1dd landed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 17:55:38 -07:00
twwu 7d18af6483 Merge branch 'main' into feat/dify-builder 2026-09-17 09:57:23 +08:00
human a5bc77eaa7 fix(api): delete offload objects outside the DB transaction (#42258) 2026-09-14 10:10:05 +00:00
CoralGarden52 5389f70719 fix(api): avoid per-row MAX(position) queries in batch segment import (#42233) 2026-09-14 02:11:23 +00:00
CoralGarden52 c6c891430c fix(rag): preserve CSV cell text in batch segment import (#42159) 2026-09-11 08:17:13 +00:00
Charles YaoandClaude Opus 4.8 9b4e095e71 refactor(dify-builder): promote model_or_none to the agent protocol
Follow-up to the reply-language feature. `_model_or_none` was private to
LlmBuilderAgent, so the advance-task wiring reached it via a fragile
`getattr(agent, "_model_or_none", lambda: None)`. Make it part of the
DifyBuilderAgent protocol (typed `object | None` to keep the pure port free of
any model-runtime import) and implement it on every conforming agent
(LlmBuilderAgent renames the private method public; PlaceholderAgent and the
test doubles return None). The Localizer wiring now uses `agent.model_or_none`
directly. Also drops the useless-return ruff nit in the wiring test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 16:34:29 -07:00
Charles YaoandClaude Opus 4.8 bd8951fbd6 feat(dify-builder): wire Localizer into the advance task (M2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 15:57:55 -07:00
twwu e808808168 Merge branch 'main' into feat/dify-builder 2026-09-09 15:55:44 +08:00
Asuka Minato 4f29213cdc test: migrate workflow node execution task sessions and ORM models to SQLite (#40571) 2026-09-09 07:27:39 +00:00
CoralGarden52 89df7a670a fix(dataset): clean multimodal attachments during reindex (#41999) 2026-09-09 01:43:57 +00:00
CoralGarden52 2cdfe24c18 fix(dataset): delete segment attachment blobs from storage (#41400) 2026-09-08 08:13:18 +00:00
twwu 9fea1cc3a8 Merge branch 'main' into feat/dify-builder 2026-09-08 15:22:53 +08:00
yyh eba589db89 refactor(api): remove legacy billing enabled state (#41917) 2026-09-07 08:29:57 +00:00
Xiyuan Chenandautofix-ci[bot] 86134ea99e feat(rbac): agent RBAC/ACL scenes and resource-locator check bundles (#41768)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-07 04:39:43 +00:00
SONG ZHIFEI 1f6dadd22c chore: remove unnecessary str() calls in annotation tasks (#41878) 2026-09-07 03:55:20 +00:00
Wu Tianwei 8b52c102a3 feat(dify-builder): add live progress and conversation streaming (#41778) 2026-09-04 18:30:44 +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 a257ac4dee Merge branch 'main' into feat/dify-builder 2026-09-03 11:12:22 +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
twwu 3eacff14a6 feat: add typed SSE interactions to Dify Builder 2026-09-03 08:48:23 +08:00
Byron.wangandautofix-ci[bot] c4ea406586 refactor(api): decouple system features and web adapters (#40772)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-01 11:50:52 +00:00
Charles YaoandClaude Opus 4.8 390eea61fb feat(dify-builder): terminal state frame carries the full SessionView
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-31 22:18:42 -07:00
twwu 433046e0de Merge branch 'main' into feat/dify-builder 2026-08-30 14:25:22 +08:00
Charles YaoandClaude Opus 4.8 02a5f01f84 feat(dify-builder): DIFY_BUILDER_AGENT_MODE gate + factory/task model wiring
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
wangxiaolei d84088ef74 feat: new user add automatic add to app / dataset whitelist (#41363) 2026-08-27 08:51:05 +00:00
非法操作 a9319c86ee refactor(api): extract workflow run archive application service (#41253) 2026-08-27 02:41:43 +00:00
twwu 7e580db1cc Merge branch 'main' into feat/dify-builder 2026-08-26 17:15:19 +08:00
heyszt 86f8b847e9 fix(api): clean multimodal attachments in batch deletion (#41256) 2026-08-26 05:10:28 +00:00
林玮 (Jade Lin)andautofix-ci[bot] 960018253b feat(api): track credit usage contexts (#41181)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-25 10:21:32 +00:00
非法操作 1afac21690 feat(api): support New Agent Beta for inline Workflow agents (#41215) 2026-08-25 05:39:41 +00:00
ff3cf5681f fix(api): attach exc_info=True to 11 logger.debug/info('...: %s', str(e)) sites — sibling of #41066 (DEBUG/INFO level) (#41077)
Co-authored-by: Harsh Kashyap <harsh23kashyap@gmail.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-24 09:08:08 +00:00
BenjaminandClaude Opus 5 ea6c15b68e fix: fall back to the batch API when the global plugin manifest is empty (#41107)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 03:33:23 +00:00
Charles YaoandClaude Opus 4.8 7e83264330 refactor: rename Workflow Copilot → Dify Builder
Project rename across api/ + web/: modules, symbols, routes
(/console/api/dify-builder/*), feature flag (DIFY_BUILDER_ENABLED),
Celery queue/tasks, the 7 DB tables (via migration df1b0114de40),
and regenerated contract artifacts. Behavior unchanged; 430 tests green,
ruff clean. Branch renamed feat/copilot-py-backend → dify-builder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 11:18:35 -07:00
Charles YaoandClaude Opus 4.8 ef255c4dde copilot: Edit service wiring + create_edit_session + merged registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 02:27:55 -07:00
Charles YaoandClaude Opus 4.8 25b897353d copilot: Build session bootstrap + capability_check handler + merged registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 21:49:48 -07:00
Charles Yao b3b4776e95 feat(workflow-copilot): opt-in per-intent canvas-event emission through apply_repair 2026-08-22 10:57:37 -07:00
Charles Yao 9a83b67cf6 feat(workflow-copilot): item/trace/canvas SSE frames + extended state frame 2026-08-22 00:15:21 -07:00
mesrop2008 23150c2319 fix(api): attach exc_info=True to logger.warning sites that drop the traceback (#41068) 2026-08-21 11:20:42 +00:00
盐粒 Yanliandyyh 013b328555 fix(agent): complete ownership-aware deletion lifecycle (#40888)
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-08-20 07:48:02 +00:00
盐粒 Yanliandautofix-ci[bot] 8874f3c80b refactor(agent): remove Agent Drive (#40887)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-19 06:34:36 +00:00