feat(sdk): hardware requirement validation for agents#1057
feat(sdk): hardware requirement validation for agents#1057theonlychant wants to merge 9 commits into
Conversation
|
@claude review this PR. |
|
The hardware-validation seam is in the right place and the fixtures + dataclass shape look good, but the PR as-shipped has three issues I'd want resolved before merge — a silent fallback that defeats the feature's own guarantee, an unrelated rewrite of a bug-fix function, and a description that doesn't match what the code actually does. 🔴 Silent fallback defeats the hardware check
except Exception as e:
cls._log.warning(f"Failed to resolve hardware devices: {e}")This swallows every non- Same pattern, smaller stakes, in 🔴 Description doesn't match the implementationPR body says: "Add hardware capability resolver that reads from Related: the description says this "Wire[s] capability-to-selection mapping through a fixed allow-list (runtime / recipe / model)." The 🟡 Unrelated rewrite of
|
- Re-raise with HardwareRequirementError context instead of swallowing exceptions in lemonade_manager.py ensure_ready() — silent fallback defeated the hardware check entirely - Drop unreachable try/except around getattr() in agent.py REQUIRED_HARDWARE resolution — getattr with a default never raises - Update PR description to match actual implementation: runtime query via get_system_info(), no ~/.gaia/ config file in Phase 1 - Scope PR title/description to hardware validation only — recipe selection is computed but not yet wired through to server startup, will follow in Phase 2
|
@claude review this again |
|
Big improvements since the last pass — the silent fallback is gone, the dead 🔴 Still open: PR description doesn't match what the code doesThe PR body still says:
Neither is true in the diff. The new docstring at 🔴 Still open: title says "capability dispatch", code only does validation
Option 1 is the smaller / lower-risk merge. 🟡 Still open:
|
- Update PR description and title to scope to validation-only, no dispatch - Revert _repair_invalid_json_escapes rewrite — out of scope, edge-case behavior change on already-escaped inputs, belongs in its own PR - Add amd_dgpu entry to _RECIPE_BY_DEVICE to keep priority list, Literal, and recipe table in sync
|
@claude review the changes |
|
Significant progress since the last pass — title is correctly scoped to validation, 🔴 New regression:
|
Infinite loop regression — the iterative pattern.sub approach never converges on canonical Issue amd#1023 inputs (e.g. C:\Users\K), each pass creating a new lone-backslash to the left. Reverted to the original single-pass re.sub(r'\(.)', _fix, s) which is already idempotent and has full test coverage. Also update PR description to match implementation: validation-only, no ~/.gaia/ config, recipe dispatch is a follow-up.
|
@claude ok you may look at it again |
|
All open items from the prior pass are resolved — this is good to merge from my side. What's fixed
Quick suggestion for the follow-up PRWhen you wire Validation half is solid. Nice iteration loop on this one. |
|
@kovtcharov @kovtcharov-amd you can review when you're free and let me know if I should add anything else |
Flag _RECIPE_BY_DEVICE mappings for review by @kovtcharov-amd before recipe dispatch is wired through to Lemonade startup in Phase 2.
Suggested PR body (summary + acceptance criteria)
Title: feat: hardware requirement validation for agents (Phase 1)
Summary
REQUIRED_HARDWARE: HardwareRequirement(min_device=...).LemonadeManager.ensure_ready(required_min_device=...)queries the running Lemonade server viaLemonadeClient.get_system_info()and validates that the host provides the declared capability tier.Scope and limitations (Phase 1)
~/.gaia/.~/.gaia/hardware config.recipeis computed and logged for debugging, but is NOT applied to the Lemonade server by this method.recipeinto the server startup path if desired; that work is intentionally scoped out here to keep Phase 1 low-risk.Why
Acceptance criteria / tests
devicespayloads returned byLemonadeClient.get_system_info().devicesfallback to CPU behavior and thatREQUIRED_HARDWAREenforcement raises aHardwareRequirementErrorwhen unmet.Agentsubclass withREQUIRED_HARDWAREtriggers the validation path during initialization.Notes for reviewers: