fix(cli): invalidate app metadata cache on 422 to clear stale data#36921
Merged
Conversation
When a run request returns HTTP 422, the cached app metadata (mode, input_schema) may be stale from a recent republish. Invalidate the cache entry so the next invocation fetches fresh metadata, and add a hint guiding the user to retry. Closes WTA-258
wylswz
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run app, invalidate the cached app metadata (mode, input_schema, etc.) so the next invocation fetches fresh data from the backend"app metadata cache cleared — if the app was recently republished, run the command again"Context
When an app is republished in Dify (mode change, schema change), the CLI's 1-hour metadata cache (
AppMetaClient) serves stale data, causing 422 errors from the backend. Previously the user had to manually delete the cache file or wait for TTL expiry.Closes WTA-258
Test plan
run.test.tstests pass