Repository navigation
fix(godcmd): answer when #model is given more than one argument - #3305
Merged
zhayujie merged 1 commit intoSep 29, 2026
Merged
Conversation
The model branch only handled no arguments and exactly one, so "#model gpt-4o now" matched nothing and left the internal result = "string" placeholder as the reply body the user was sent. Its two one-argument siblings, set_openai_api_key and set_gpt_model, both answer a wrong argument count with usage text; the branch now does the same.
4 of 8 tasks
Owner
|
Merged, thanks! We'll tweak the message on master to "只能指定一个模型名称", since this branch only fires on more than one argument. |
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.
What
#model(#模型) handled no arguments and exactly one argument, and nothing else, so#model gpt-4o nowmatched no branch and left the internalresult = "string"placeholder (plugins/godcmd/godcmd.py:262) as the reply body -- the bot sent the bare wordstringback to the user. The branch now answers a wrong argument count with usage text,请提供一个模型名称, the way its two one-argument siblings already do (set_openai_api_keyline 305,set_gpt_modelline 319). Zero-argument and single-argument behaviour is untouched, including the existing模型名称不存在answer.Fixes #3304
Checks
pytest tests/test_godcmd_model_argument_count.pyfails the first case withAssertionError: assert 'string' != 'string', i.e. the reply the user is handed really is the placeholder.FAILEDset is identical (32 pre-existing failures, all environment-bound on Windows -- scheduler timezone, symlink pruning, thergbackend parity case,/proc/self/environprobes).passedgoes 2259 -> 2262, exactly the three new cases.ruff check --select F --ignore F403,F405) on both changed files: All checks passed.The new tests build the plugin against a
tmp_pathconfig carryingadmin_usersand stubconf()andBridge, so no network is touched and noBridge().reset_bot()is called;conf()["model"]is never written.