fix(entity-ui): treat absent harness.kind as pi_core for Pi permissions visibility - #5713
fix(entity-ui): treat absent harness.kind as pi_core for Pi permissions visibility#5713WahidSaeed wants to merge 1 commit into
Conversation
…ns visibility The runner defaults an omitted harness.kind to pi_core (agents/dtos.py's harness: str = "pi_core") and enforces Pi's allow/ask/deny permission rules accordingly. The Model & harness panel didn't apply the same default: harnessValue stayed null, so isPiHarness was false and the PiPermissionsControl was hidden even though the run enforces it. Extract the check into isPiHarnessValue() in connectionUtils.ts (an absent/null harness counts as Pi) and use it in useModelHarness's isPiHarness. Runtime behavior is unchanged; this is a visibility fix only. Fixes Agenta-AI#5661
|
@WahidSaeed is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @WahidSaeed, thanks for opening a pull request. 🙏 This PR was automatically closed because it does not yet meet our contribution requirements:
We ask for this so every change is documented and demonstrably tested before review. How to get it reopened See the Contributing guide and Creating your first PR. If you think this was closed in error, leave a comment and a maintainer will take a look. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds a shared Pi harness detector, treats absent harness values as Pi, updates model harness handling to use the detector, and adds unit coverage for supported and rejected values. ChangesPi harness detection
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
Summary
harness.kind, the runner treats the harness aspi_core(agents/dtos.py'sharness: str = "pi_core"default) and enforces the Piharness.permissionsallow/ask/deny rules at runtime.harnessValuestayednullfor such a config, soisPiHarnesswasfalseandPiPermissionsControlwas hidden — even though the run enforces Pi permission gating. The author couldn't see or edit the rules that apply to their own runs.allow_reads) was never affected.Changes
isPiHarnessValue()inconnectionUtils.ts, alongside the other pure harness-capability helpers (harnessSupportsUserMcp,harnessAllowsModel, ...). An absent/null harness now counts as Pi.useModelHarness.tsx'sisPiHarnessnow uses this helper instead of the inline=== "pi_core" || === "pi_agenta"check.Fixes #5661
Test plan
isPiHarnessValueunit test inconnectionUtils.test.tscoveringundefined,null(the{harness: {}}case),"pi_core","pi_agenta", and"claude".pnpm vitest runinagenta-entity-ui: 302/302 tests pass.tsc --noEmitinagenta-entity-ui: no errors.