Skip to content

fix: the justfile syntax errror, GPU information cannot be read#669

Open
xorss wants to merge 1 commit into
jamiepine:mainfrom
xorss:fix-justfile
Open

fix: the justfile syntax errror, GPU information cannot be read#669
xorss wants to merge 1 commit into
jamiepine:mainfrom
xorss:fix-justfile

Conversation

@xorss
Copy link
Copy Markdown

@xorss xorss commented May 15, 2026

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Profile composition language support

Layer / File(s) Summary
UI and API client wiring
app/src/components/Generation/FloatingGenerateBox.tsx, app/src/lib/api/client.ts
FloatingGenerateBox passes form.getValues('language') to apiClient.composeWithPersonality; composeWithPersonality now accepts language and includes it in the POST body to /profiles/{profileId}/compose.
Server request model and service prompt
backend/models.py, backend/routes/profiles.py, backend/services/personality.py
Adds ComposeRequest Pydantic model with language; compose endpoint accepts ComposeRequest and forwards it to personality.compose_as_profile, which now imports language mappings and appends an "Output language: …" directive based on data.language.

Windows GPU Detection Syntax

Layer / File(s) Summary
Line-continuation markers for GPU detection
justfile
Windows setup-python GPU detection lines now include Justfile line-continuation markers and PowerShell statement terminators for multi-line expressions; logic unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through code and light,
I pass the language, make prompts polite,
Small Windows backslashes snug and tight,
Compose replies in chosen tongue tonight,
Hooray—everything composes just right!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims to fix a justfile syntax error affecting GPU information, but the PR includes substantial backend and frontend changes for language selection in composition that are not mentioned in the title. Update the title to reflect the main change (language selection feature) or restructure as a multi-commit PR with accurate titles for each logical change.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 win

Handle optional data consistently before dereferencing.

data is nullable in Line 76, but Line 90 unconditionally accesses data.language. That can crash with AttributeError for 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

📥 Commits

Reviewing files that changed from the base of the PR and between d6e6fa5 and f3de0f1.

📒 Files selected for processing (5)
  • app/src/components/Generation/FloatingGenerateBox.tsx
  • app/src/lib/api/client.ts
  • backend/models.py
  • backend/routes/profiles.py
  • backend/services/personality.py

@xorss xorss marked this pull request as draft May 22, 2026 08:07
@xorss
Copy link
Copy Markdown
Author

xorss commented May 22, 2026

I didn't notice the branch and pushed some code. But it has been withdrawn.

@xorss xorss marked this pull request as ready for review May 22, 2026 08:16
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.

1 participant