Skip to content

fix(entity-ui): treat absent harness.kind as pi_core for Pi permissions visibility - #5713

Closed
WahidSaeed wants to merge 1 commit into
Agenta-AI:mainfrom
WahidSaeed:fix/5661-pi-permissions-visibility
Closed

fix(entity-ui): treat absent harness.kind as pi_core for Pi permissions visibility#5713
WahidSaeed wants to merge 1 commit into
Agenta-AI:mainfrom
WahidSaeed:fix/5661-pi-permissions-visibility

Conversation

@WahidSaeed

Copy link
Copy Markdown

Summary

  • When an agent config omits harness.kind, the runner treats the harness as pi_core (agents/dtos.py's harness: str = "pi_core" default) and enforces the Pi harness.permissions allow/ask/deny rules at runtime.
  • The Model & harness panel didn't apply the same default: harnessValue stayed null for such a config, so isPiHarness was false and PiPermissionsControl was hidden — even though the run enforces Pi permission gating. The author couldn't see or edit the rules that apply to their own runs.
  • This is a visibility gap only; the runtime permission gate (including allow_reads) was never affected.

Changes

  • Extracted the check into isPiHarnessValue() in connectionUtils.ts, alongside the other pure harness-capability helpers (harnessSupportsUserMcp, harnessAllowsModel, ...). An absent/null harness now counts as Pi.
  • useModelHarness.tsx's isPiHarness now uses this helper instead of the inline === "pi_core" || === "pi_agenta" check.

Fixes #5661

Test plan

  • Added isPiHarnessValue unit test in connectionUtils.test.ts covering undefined, null (the {harness: {}} case), "pi_core", "pi_agenta", and "claude".
  • pnpm vitest run in agenta-entity-ui: 302/302 tests pass.
  • tsc --noEmit in agenta-entity-ui: no errors.

…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
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@WahidSaeed is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the Frontend label Aug 3, 2026
@CLAassistant

CLAassistant commented Aug 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hi @WahidSaeed, thanks for opening a pull request. 🙏

This PR was automatically closed because it does not yet meet our contribution requirements:

  • This PR changes functional code (SDK, API, or frontend) but includes no demo. Add a screenshot or short video of the change. Only test-only, docs-only, or chore changes may skip it.

We ask for this so every change is documented and demonstrably tested before review.

How to get it reopened
Update the PR description (and add a demo recording if your change touches functional code). The bot reopens the PR automatically once the requirements are met. No need to open a new one.

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.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Aug 3, 2026
@github-actions github-actions Bot closed this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb332a38-65ed-4ec3-9dc4-12a22ea2a593

📥 Commits

Reviewing files that changed from the base of the PR and between 69e2165 and 783f923.

📒 Files selected for processing (3)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/connectionUtils.ts
  • web/packages/agenta-entity-ui/tests/unit/connectionUtils.test.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of supported Pi harness configurations, including missing and supported harness values.
    • Ensured permission behavior is applied consistently across Pi harness variants.
  • Tests
    • Added coverage for supported, absent, and unsupported harness values.

Walkthrough

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

Changes

Pi harness detection

Layer / File(s) Summary
Shared Pi harness helper and coverage
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/connectionUtils.ts, web/packages/agenta-entity-ui/tests/unit/connectionUtils.test.ts
Adds isPiHarnessValue for null, undefined, pi_core, and pi_agenta. Tests reject claude.
Model harness permission integration
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
Uses isPiHarnessValue when determining whether Pi permissions apply.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend incomplete-pr PR is missing required template sections or a demo recording size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(bug) Pi permissions controls are hidden when the agent config omits harness.kind

2 participants