Skip to content

refactor: clean up structural dispatch patterns#354

Merged
WH-2099 merged 2 commits into
mainfrom
refactor/329-structural-cleanup-candidates
Jul 6, 2026
Merged

refactor: clean up structural dispatch patterns#354
WH-2099 merged 2 commits into
mainfrom
refactor/329-structural-cleanup-candidates

Conversation

@WH-2099

@WH-2099 WH-2099 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Validation

  • just check
  • just test

Closes #329

@WH-2099 WH-2099 self-assigned this Jul 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several refactorings and cleanups across the codebase, including simplifying enum value lookups using direct instantiation, utilizing modern string methods like removeprefix and removesuffix, leveraging typing.get_args and typing.get_origin in the documentation generator, and extracting common Notion parsing logic. It also introduces a centralized ensure_prompt_message helper to instantiate role-specific prompt messages. The review feedback highlights two key areas for improvement: first, copying parameter.input_schema in strategy.py to prevent unintended side-effects from mutating a shared dictionary; second, adding defensive type checking in ensure_prompt_message to gracefully handle non-mapping inputs instead of raising an AttributeError.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/dify_plugin/interfaces/agent/strategy.py
Comment thread src/dify_plugin/entities/model/message.py
Mairuis
Mairuis previously approved these changes Jul 6, 2026
@WH-2099 WH-2099 marked this pull request as ready for review July 6, 2026 18:48
@WH-2099 WH-2099 enabled auto-merge (squash) July 6, 2026 18:48
@WH-2099 WH-2099 disabled auto-merge July 6, 2026 18:48
@WH-2099 WH-2099 enabled auto-merge (squash) July 6, 2026 18:48
@WH-2099 WH-2099 merged commit 2963221 into main Jul 6, 2026
4 checks passed
@WH-2099 WH-2099 deleted the refactor/329-structural-cleanup-candidates branch July 6, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: track structural cleanup candidates from review follow-up

3 participants