-
Notifications
You must be signed in to change notification settings - Fork 609
fix(frontend): pi permissions controls hidden when harness kind missing #5706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oforiwaasam
wants to merge
4
commits into
Agenta-AI:main
Choose a base branch
from
oforiwaasam:fix/pi-permissions-hidden-controls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+32
−3
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0509597
fix(frontend): default missing harness kind to pi_core in model harne…
oforiwaasam 4d03ca0
test(frontend): cover harness kind fallback and preservation behavior
oforiwaasam a1e4760
Merge branch 'Agenta-AI:main' into fix/pi-permissions-hidden-controls
oforiwaasam e96ef32
test(frontend): add codex harness to unit test
oforiwaasam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
web/packages/agenta-entity-ui/tests/unit/useModelHarness.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * Unit tests for the resolveHarnessKindValue function used by the model harness UI. | ||
| * | ||
| * These tests lock in the fallback behavior for omitted or undefined harness values and confirm | ||
| * that explicit harness selections such as `pi_agenta` and `claude` are preserved unchanged. | ||
| * Runs under @agenta/entity-ui's own vitest runner. | ||
| */ | ||
| import {describe, expect, it} from "vitest" | ||
|
|
||
| import {resolveHarnessKindValue} from "../../src/DrillInView/SchemaControls/agentTemplate/useModelHarness" | ||
|
|
||
| describe("resolveHarnessKindValue", () => { | ||
| it("defaults an omitted harness kind to pi_core", () => { | ||
| expect(resolveHarnessKindValue({})).toBe("pi_core") | ||
| expect(resolveHarnessKindValue({kind: undefined})).toBe("pi_core") | ||
| }) | ||
|
|
||
| it("preserves explicit harness kinds", () => { | ||
| expect(resolveHarnessKindValue({kind: "pi_agenta"})).toBe("pi_agenta") | ||
| expect(resolveHarnessKindValue({kind: "claude"})).toBe("claude") | ||
| expect(resolveHarnessKindValue({kind: "codex"})).toBe("codex") | ||
| }) | ||
| }) |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Agenta-AI/agenta
Length of output: 4853
🏁 Script executed:
Repository: Agenta-AI/agenta
Length of output: 7439
Align the resolver type with the actual configuration type.
harnesscomes fromasObject("harness"), which returnsRecord<string, unknown>, whileresolveHarnessKindValueis declared as{kind?: string} | null | undefined. This type mismatch makes the calls at Lines 180 and 377 fail type checking. Model the input as{kind?: unknown} | null | undefined, with no change to the runtime behavior.Proposed fix
📝 Committable suggestion