Skip to content

refactor(backend): typing for park and unpark operations#517

Open
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/type-park-target
Open

refactor(backend): typing for park and unpark operations#517
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/type-park-target

Conversation

@Graffioh

@Graffioh Graffioh commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Replace string-based ModelBackend::park and unpark arguments with a typed ParkTarget enum. Centralize enum/string conversion, parse daemon arguments at the protocol boundary, and preserve each backend's existing behavior for commands without an explicit target.

Validation

  • Verified all ModelBackend implementations, internal callers, and test mocks use the typed API.
  • git diff --check passes.
  • Tests not run since the remote GPU test machine is currently offline - i can check later if needed but it's only refactor so should be fine

Review in cubic

@Graffioh Graffioh marked this pull request as ready for review July 13, 2026 06:21

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 17 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="server/src/qwen3/qwen3_backend.h">

<violation number="1" location="server/src/qwen3/qwen3_backend.h:79">
P1: Bare `park` and `unpark` commands no longer park/reload Qwen3 weights: they now pass `ParkTarget::Empty`, which this backend rejects. Preserve Qwen3's no-target behavior by treating `Empty` as including the target model in both implementations.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


bool park(const std::string & what) override;
bool unpark(const std::string & what) override;
bool park(ParkTarget target) override;

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.

P1: Bare park and unpark commands no longer park/reload Qwen3 weights: they now pass ParkTarget::Empty, which this backend rejects. Preserve Qwen3's no-target behavior by treating Empty as including the target model in both implementations.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At server/src/qwen3/qwen3_backend.h, line 79:

<comment>Bare `park` and `unpark` commands no longer park/reload Qwen3 weights: they now pass `ParkTarget::Empty`, which this backend rejects. Preserve Qwen3's no-target behavior by treating `Empty` as including the target model in both implementations.</comment>

<file context>
@@ -76,8 +76,8 @@ class Qwen3Backend : public ModelBackend {
 
-    bool park(const std::string & what) override;
-    bool unpark(const std::string & what) override;
+    bool park(ParkTarget target) override;
+    bool unpark(ParkTarget target) override;
     bool is_target_parked() const override { return parked_; }
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

false positive.

before this PR "" was not considered in the condition -> it returned false

now we have ParkTarget::Empty, but qwen3 still checks only for TargetModel and DraftModel -> still return false

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