Commit Graph
1520 Commits
Author SHA1 Message Date
Charles YaoandClaude Opus 4.8 cd5fb6bbf0 fix(dify-builder): ground model on all model-bearing nodes, carry branch handles, clean test lint
Final consolidated fix wave from whole-branch review of the Real Build +
Edit Cognition slice:

- _ground now overwrites the model dict on ANY create_node whose config
  carries a model dict (llm, question-classifier, parameter-extractor),
  not just "llm", so a drifted/hallucinated provider/name on those other
  node types no longer flows through ungrounded.
- to_intents now carries a generator edge's sourceHandle/targetHandle
  into the connect intent's args (source_handle/target_handle) so
  branching nodes (if-else, question-classifier) wire onto the correct
  port instead of collapsing onto the default handle; edges without
  handles still produce bare {from_node, to_node} args.
- Cleared the 17 ruff errors (PT018/E302/E306/E501) across the slice's
  test files by splitting composite asserts, adding missing blank
  lines, and wrapping long lines -- no assertions weakened, no noqa.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 14:22:19 -07:00
Charles YaoandClaude Opus 4.8 a07dc0e766 fix(dify-builder): correct method count in llm_agent docstring
Docstring said "9 now use real LLM cognition" but enumerated 3 Fix +
6 Build + 3 Edit = 12 methods (Task B3 added the 3 Edit methods
without updating the leading count). Fix the count to 12 of 14 to
match the enumerated list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 14:06:25 -07:00
Charles YaoandClaude Opus 4.8 27be3de30a feat(dify-builder): wire real Edit cognition into LlmBuilderAgent
analyze_impact/propose_edit_plan/build_edit_intents now call
services.dify_builder.agent.edit.* via _model_or_none() instead of
delegating to the canned PlaceholderAgent. 9 of the Protocol's 14
Build/Edit/Fix methods now use real LLM cognition; only
generate_mock_inputs and propose_build_repair (returns []) remain
deferred pending the live-test step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 14:00:58 -07:00
Charles YaoandClaude Opus 4.8 f801481fdc fix(dify-builder): guard analyze_impact target_node_ids; drop ARG noqa in edit tests
analyze_impact could raise on a non-list target_node_ids from the LLM (no
isinstance guard, unlike fields/values) -- violated the never-crash
contract. Guard it the same way. Also collapse the fake models' invoke_llm
signatures to **_kwargs (underscore-prefixed, no noqa) per the ARG lint
constraint, and pin two more malformed-shape degrade paths
(build_edit_intents non-list intents, propose_edit_plan non-list plan).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 13:54:08 -07:00
Charles YaoandClaude Opus 4.8 f5458e16b3 feat(dify-builder): real Edit cognition (impact/plan/intents via Fix pattern)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 13:41:59 -07:00
Charles YaoandClaude Opus 4.8 8683e6517c feat(dify-builder): wire real Build cognition + neutral empty test-repair
LlmBuilderAgent's 6 Build methods (analyze_goal, propose_plan_v1,
discover_resources, bind_resources, build_nodes, learn_from_build) now
delegate to services.dify_builder.agent.build instead of the canned
PlaceholderAgent. propose_build_repair returns [] -- there's no real
failure signal to diagnose until the live test step is de-canned.

handle_test_and_repair now conditions the error card + apply_repair on
a non-empty propose_build_repair result: placeholder mode keeps today's
"found and fixed" arc, while real cognition (which never reports a
failure yet) emits a neutral "no issues found" review summary instead
of a fake error/fix on a hardcoded node id that real build_nodes
wouldn't have generated anyway.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 12:25:14 -07:00
Charles YaoandClaude Opus 4.8 02edd73204 fix(dify-builder): stop fabricating llm completion_params, dedupe dataset_ids grounding
Grounding only overwrites provider+name on an llm node's model dict now,
preserving whatever mode/completion_params the generator produced instead
of synthesizing a temperature when none was present. knowledge-retrieval
grounding now assigns each node its own dataset_ids list copy instead of
aliasing one shared list across every KB node in the graph.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 12:15:08 -07:00
Charles YaoandClaude Opus 4.8 dc85ea51a2 feat(dify-builder): build_nodes via WorkflowGenerator with model+dataset grounding
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 12:04:58 -07:00
Charles YaoandClaude Opus 4.8 0ba1f932a9 fix(dify-builder): address review findings for build.py cognition
- Fix S110: replace bare except-pass with explicit degrade behavior
- Fix E501: wrap long function signatures to <=120 chars
- Fix I001: sort imports in test file (resources to top)
- Fix PT018: split composite assertions into separate statements
- Add _BoomInstance for provider-error testing
- Add 5 degrade tests (analyze_goal, propose_plan_v1 x2, discover_resources, learn_from_build)
- Remove unused _KIND_BY_PREFIX dict
- Add noqa comments for test mock arguments

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:50:40 -07:00
Charles YaoandClaude Opus 4.8 2e77396d39 feat(dify-builder): real Build light cognition (analyze/plan/discover/bind/learn)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:40:05 -07:00
Charles YaoandClaude Opus 4.8 bcd0f59100 fix(dify-builder): prevent duplicate start node ids on multiple starts
Only map the first start-type node to canonical 'start'; additional starts
retain their original ids to prevent collisions and ambiguous intents.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:36:02 -07:00
Charles YaoandClaude Opus 4.8 4ec3e5bfe7 feat(dify-builder): translate generator graph into build intents
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:30:08 -07:00
Charles YaoandClaude Opus 4.8 a5f8d71eb7 fix(dify-builder): dataset visibility + normalization guard + test coverage
FINDING 1 (dataset visibility): DatasetService.get_datasets requires user
parameter and silently omits ONLY_ME/PARTIAL_TEAM datasets on RBAC tenants.
Query Dataset model directly by tenant_id for complete grounding inventory.

FINDING 2 (normalization guard): Move fetch+normalize inside _safe to prevent
malformed records from raising after _safe returns. Use lambda builders to wrap
complete resource transformation including record normalization.

FINDING 3 (test coverage): Add test_mixed_failure_partial_success (one source
fails, others succeed) and test_malformed_tool_record_degrades (missing
tool_name key gracefully degrades).

Minor: compute model id once and reuse for both id and label fields; ensure
E302 two blank lines between test functions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:24:56 -07:00
Charles YaoandClaude Opus 4.8 d976f9bf66 feat(dify-builder): tenant resource inventory (models/datasets/tools)
Implement resources.py with list_tenant_resources() to normalize tenant's
configured models, datasets, and tools to ResourceRef(id, label, meta,
readiness). Each source degrades to empty list on failure for graceful
degradation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 11:15:57 -07:00
Charles YaoandClaude Opus 4.8 28a4dad58f feat(dify-builder): persist goal-shaped form_fields on context
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 10:54:36 -07:00
Charles YaoandClaude Opus 4.8 e44ab9bb57 fix(dify-builder): broaden filter_applicable's except, fix stale docstring + typo
filter_applicable's per-intent try/except only caught (ValueError, TypeError),
so a hallucinated insert_between with a non-dict edge arg raised an uncaught
AttributeError and crashed the whole advance instead of being rejected by the
dry-run. Broaden to except Exception (ruff does not flag it, so no noqa is
added). Add a regression test for the string-edge case.

Also update llm_agent.py's stale module docstring (Fix cognition is now real,
not delegated; Protocol has 14 methods, not 13) and fix a stray closing paren
in a test_handlers_fix.py comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 02:39:08 -07:00
Charles YaoandClaude Opus 4.8 8a1f0382d3 feat(dify-builder): wire LlmBuilderAgent Fix methods to real cognition
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 02:12:46 -07:00
Charles YaoandClaude Opus 4.8 8078f5c169 fix(dify-builder): resolve connect-intent endpoint types in _touched_node_types
_touched_node_types looked up connect intents via a nonexistent node_id key,
always resolving to "" and missing the external-side-effect type of either
endpoint. Branch connect on from_node/to_node instead, and add a test proving
the external risk floor fires on a non-structural set_node_config against an
http-request node.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 02:03:59 -07:00
Charles YaoandClaude Opus 4.8 024c76f032 feat(dify-builder): real Fix propose_repair with dry-run validation + risk floor
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 01:56:13 -07:00
Charles YaoandClaude Opus 4.8 a84491071f feat(dify-builder): real Fix diagnose + diagnose_checklist cognition
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 01:46:55 -07:00
Charles YaoandClaude Opus 4.8 6714e5a1d0 fix(dify-builder): consolidate APPLY_FNS, simplify filter_applicable, add dup-id test
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 01:40:29 -07:00
Charles YaoandClaude Opus 4.8 f371732edc feat(dify-builder): graph_ops.filter_applicable dry-run validation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-29 01:32:06 -07:00
Charles YaoandClaude Opus 4.8 c73dcc7720 fix(dify_builder): final review fixes — wiring test, stop char-split, ping log, lint sweep
- test_wiring.py: expected dict was missing SessionView's new `model` field
- model_resolver.normalize_completion_params: a string `stop` was being
  char-split into a list of letters instead of wrapped in a single-element
  list; added a regression test
- controllers/console/dify_builder._ping: log the exception server-side
  before returning the ok:false envelope
- ruff-clean the slice's new/extended test files (ARG001/ARG002/ARG005 via
  precise noqa, PT018 compound-assert splits, E306, E501) with no change
  to test behavior or assertion meaning

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 affe84777a feat(dify-builder): agent ping endpoint for live LLM connectivity
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 4c0efd947d feat(dify-builder): echo chosen model in SessionView + regen contract
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 f5815c8723 feat(dify-builder): accept + validate + stamp model_config on create
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07: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
Charles YaoandClaude Opus 4.8 6d1ed0a4b4 feat(dify-builder): LlmBuilderAgent shell delegating to PlaceholderAgent
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 90fda2b665 fix(dify-builder): enforce ruff linting on LLM helper
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 68b82e8dd8 feat(dify-builder): shared LLM invoke/parse/retry helper
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 6bf013da3a feat(dify-builder): model resolver + BadRequestError -> 400
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:27 -07:00
Charles YaoandClaude Opus 4.8 71a1e51917 feat(dify-builder): add model_config to session context + serde
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 22:51:26 -07:00
twwu 7e580db1cc Merge branch 'main' into feat/dify-builder 2026-08-26 17:15:19 +08:00
Byron.wang 30e6069851 refactor(api): thin OAuth controllers and extract application services (#40692) 2026-08-26 07:33:37 +00:00
73dd8739ef feat: optimize resource access config logic (#41164)
Co-authored-by: fatelei <fatelei@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-26 07:18:57 +00:00
林玮 (Jade Lin) f5aaa50a30 fix(auth): normalize Gmail registration emails (#41249) 2026-08-26 07:14:27 +00:00
林玮 (Jade Lin) 8c9f248520 fix(api): attribute Skill Builder credit usage (#41290) 2026-08-26 07:02:45 +00:00
非法操作 c563528a2d refactor(api): standardize compliance downloads (#41057) 2026-08-26 06:32:13 +00:00
非法操作 c4ace15afd refactor(api): extract console app site command boundary (#41216) 2026-08-26 06:31:06 +00:00
d5a8ace1c4 fix(rag-pipeline): mark credential-free datasources as authorized (#39772)
Co-authored-by: ccl125 <ccl125@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: FFXN <31929997+FFXN@users.noreply.github.com>
2026-08-26 05:44:10 +00:00
Stephen Zhou 1c6f0a0388 fix(api): restore Service API OpenAPI semantics (#41274) 2026-08-26 05:05:36 +00:00
Stephen Zhouandautofix-ci[bot] 92016aa139 fix(api): align Service API OpenAPI contract (#41248)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-25 10:54:14 +00:00
wangxiaoleiandautofix-ci[bot] a6fe278662 feat: hide add library skill in agent ui (#41250)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-25 10:26:06 +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
wangxiaolei ddcdbb2d14 feat: add skill enable feature switch (#41246) 2026-08-25 08:42:15 +00:00
非法操作 1afac21690 feat(api): support New Agent Beta for inline Workflow agents (#41215) 2026-08-25 05:39:41 +00:00
非法操作andautofix-ci[bot] ef92cb7c65 refactor(api): complete account education boundary (#41153)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-25 01:48:12 +00:00
林玮 (Jade Lin)andautofix-ci[bot] 70a513fc62 fix(api): scope hosted credits by tenant plan (#41131)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-24 06:35:42 +00:00
+21 0024a845f7 feat: support agent skill (#39675)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: 起岚 <155608604+xiaoyaoqilan@users.noreply.github.com>
Co-authored-by: Parman Mohammadalizadeh <prmma23@gmail.com>
Co-authored-by: Escape0707 <tothesong@gmail.com>
Co-authored-by: Xin Zhang <zhangxin@dify.ai>
Co-authored-by: iridescentWen <66297467+iridescentWen@users.noreply.github.com>
Co-authored-by: Bond Zhu <37842169+MRZHUH@users.noreply.github.com>
Co-authored-by: KVOJJJin <jzongcode@gmail.com>
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: 非法操作 <hjlarry@163.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: Chester <superdiao6@gmail.com>
Co-authored-by: WH-2099 <wh2099@pm.me>
Co-authored-by: Jony <619963502@qq.com>
Co-authored-by: Jony <13896935+zyz619963502zyz@users.noreply.github.com>
Co-authored-by: Harsh Kashyap <harsh.kashyap2001@gmail.com>
Co-authored-by: Harsh Kashyap <Harsh23Kashyap@users.noreply.github.com>
Co-authored-by: kenwoodjw <blackxin55+@gmail.com>
Co-authored-by: csurong <csurong1@gmail.com>
Co-authored-by: caosurong <surong.cao@thinkingdata.cn>
Co-authored-by: Taranum Wasu <81034301+Taranum01@users.noreply.github.com>
Co-authored-by: Taranum01 <50813317+Taranum01@users.noreply.github.com>
Co-authored-by: Pranav Agarwal <agarwalpranav0711@gmail.com>
Co-authored-by: Stephen Zhou <hi@hyoban.cc>
Co-authored-by: zl86790 <marshal_li_b@163.com>
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
Co-authored-by: yunlu.wen <yunlu.wen@dify.ai>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
2026-08-24 05:29:14 +00:00
3f7e6cdcb4 fix(tts): propagate and validate actual audio MIME (#41043)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: WH-2099 <wh2099@pm.me>
2026-08-24 03:38:09 +00:00