Skip to content

fix: treat absent harness.kind as pi_core to match runner default - #5674

Closed
waterWang wants to merge 1 commit into
Agenta-AI:mainfrom
waterWang:fix/issue-5661-pi-permissions-default
Closed

fix: treat absent harness.kind as pi_core to match runner default#5674
waterWang wants to merge 1 commit into
Agenta-AI:mainfrom
waterWang:fix/issue-5661-pi-permissions-default

Conversation

@waterWang

Copy link
Copy Markdown

Description

When an agent config omits harness.kind, the runner treats the harness as pi_core — all seven Pi built-ins are active and the harness.permissions allow/ask/deny rules are enforced at runtime. However, the UI kept harnessValue as null when harness.kind was absent, making isPiHarness and hasPiPermissions evaluate to false, which hid the Pi permissions controls.

Fix

Changed the default value of harnessValue from null to pi_core when harness.kind is not a string, matching the runner's default behavior. This covers both:

  • Absent harness.kind: {harness: {}} — the kind field is undefined
  • Missing harness block entirely: the hook receives an empty default

Changes

- const harnessValue = typeof harness.kind === "string" ? (harness.kind as string) : null
+ const harnessValue = typeof harness.kind === "string" ? (harness.kind as string) : "pi_core"

Fixes #5661

When an agent config omits harness.kind, the runner defaults to pi_core
but the UI kept harnessValue as null, hiding PiPermissionsControl.
Now matches the runner behavior by defaulting to pi_core.

Fixes Agenta-AI#5661
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@waterWang 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

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

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

  • The Summary section is missing or empty. Describe what changed and why using the PR template.
  • 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: ac8065bf-6393-4b91-b4a1-fe11d706ac20

📥 Commits

Reviewing files that changed from the base of the PR and between 99ab003 and d1c0a99.

📒 Files selected for processing (1)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved model harness behavior by defaulting to the standard harness when no harness type is specified.

Walkthrough

The UI now defaults an absent harness.kind to "pi_core" in useModelHarness.

Changes

Harness selection

Layer / File(s) Summary
Default harness selection
web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
useModelHarness now uses "pi_core" instead of null when harness.kind is absent or not a string.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • Agenta-AI/agenta#5461: This PR also modifies useModelHarness.tsx, but it changes model-label generation rather than harness defaults.
✨ 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:XS This PR changes 0-9 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