fix: the justfile syntax errror, GPU information cannot be read#669
fix: the justfile syntax errror, GPU information cannot be read#669xorss wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughAdds language selection to profile composition flows (UI → ApiClient → server → personality service) and a small Justfile Windows GPU-detection syntax fix; the compose request now carries an explicit language, backend accepts and validates it, and the service appends an output-language directive. ChangesProfile composition language support
Windows GPU Detection Syntax
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
backend/services/personality.py (1)
76-90:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winHandle optional
dataconsistently before dereferencing.
datais nullable in Line 76, but Line 90 unconditionally accessesdata.language. That can crash withAttributeErrorfor valid calls under the current signature.Suggested fix
async def compose_as_profile( personality: str | None, - data: models.ComposeRequest | None = models.ComposeRequest(language="en"), + data: models.ComposeRequest | None = None, model_size: str | None = None, ) -> PersonalityResult: @@ - system_prompt = f"{_build_system_prompt(text, _COMPOSE_TASK)}. Output language: {LANGUAGE_CODE_TO_NAME.get(data.language if data.language else 'en')}" + request_data = data or models.ComposeRequest(language="en") + language_name = LANGUAGE_CODE_TO_NAME.get( + request_data.language, LANGUAGE_CODE_TO_NAME.get("en", "English") + ) + system_prompt = ( + f"{_build_system_prompt(text, _COMPOSE_TASK)}. " + f"Output language: {language_name}" + )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/services/personality.py` around lines 76 - 90, The code dereferences optional parameter data when building system_prompt (uses data.language) which can raise AttributeError; before using it, ensure data is non-null and has a language: compute a local language variable like lang = data.language if data and data.language else 'en' (or instantiate a default models.ComposeRequest when data is None), then use LANGUAGE_CODE_TO_NAME.get(lang) in the construction of system_prompt; update any related references (_build_system_prompt, system_prompt) to use that safe local variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@backend/services/personality.py`:
- Around line 76-90: The code dereferences optional parameter data when building
system_prompt (uses data.language) which can raise AttributeError; before using
it, ensure data is non-null and has a language: compute a local language
variable like lang = data.language if data and data.language else 'en' (or
instantiate a default models.ComposeRequest when data is None), then use
LANGUAGE_CODE_TO_NAME.get(lang) in the construction of system_prompt; update any
related references (_build_system_prompt, system_prompt) to use that safe local
variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e901947e-8412-4f22-8961-059a0c40145a
📒 Files selected for processing (5)
app/src/components/Generation/FloatingGenerateBox.tsxapp/src/lib/api/client.tsbackend/models.pybackend/routes/profiles.pybackend/services/personality.py
|
I didn't notice the branch and pushed some code. But it has been withdrawn. |
The absence of
\prevents the GPU information cannot be read.(Windows)i don't know JUST. you can ignore this issue if it can work in other development environment. ;D