[Feature] Allow defining harness settings (e.g. Claude settings.json) in a custom agent (#73) - #84
[Feature] Allow defining harness settings (e.g. Claude settings.json) in a custom agent (#73)#84jan21deepak wants to merge 1 commit into
Conversation
Add executor.config.harness_settings so agents can declare portable Claude Code settings.json-shaped configuration (permissions, env, etc.). - Parse harness_settings as structured YAML in bundle config - Merge agent settings into claude-native --settings sidecar with Omnigent framework keys (hooks, statusLine, apiKeyHelper) winning - Thread harness_settings to claude-sdk via HARNESS_CLAUDE_SDK_SETTINGS_OVERLAY - Add unit tests for parsing, merge semantics, and spawn-env threading Co-authored-by: jan21deepak <jan21deepak@users.noreply.github.com>
|
bugbot run |
| json.dumps({"apiKeyHelper": api_key_helper}, separators=(",", ":")) | ||
| if api_key_helper | ||
| else None | ||
| json.dumps(settings_dict, separators=(",", ":")) if settings_dict else None |
There was a problem hiding this comment.
SDK settings merge inconsistent
Medium Severity
On the claude-sdk harness, agent harness_settings are copied into the CLI settings JSON, while Omnigent’s permission_mode is passed separately and still drives MCP allowlisting and the can_use_tool gate. Unlike the native path, those two permission sources are not merged with framework precedence, so permissions.defaultMode in the overlay can disagree with the executor’s effective permission mode.
Reviewed by Cursor Bugbot for commit 13a28f5. Configure here.
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 13a28f5. Configure here.


Opened automatically by Cursor Forge as a same-repo PR on
jan21deepak/omnigentafter the Cloud Agent pushed
cursor/harness-settings-in-agent-47a6(not against an upstream parent).Fixes #73.
Cursor agent:
bc-0d9a1fcb-ae43-413b-82ef-e796c59947a6Note
Medium Risk
Changes how Claude Code launch settings are composed (permissions, env, etc.) on both native and SDK paths; merge rules protect hooks and apiKeyHelper but misconfigured agent settings could still alter runtime behavior.
Overview
Agents can declare a
harness_settingsobject underexecutor.config(parsed as nested YAML) to supply portable Claude Codesettings.jsonfragments—e.g.permissions,env—without duplicating global user settings.A new
harness_agent_settingsmodule extracts that config, serializes it for spawn env, and deep-merges it with Omnigent’s launch-time settings. Framework-owned keys (hooks,statusLine,apiKeyHelper) and other framework values always win; nested dicts (like permissions) merge so launch flags such as--permission-modestill override agent defaults.Claude-native launches read settings from the spec in orchestration and fold them into the invocation-local
--settingspayload viabuild_hook_settings. Claude SDK harnesses receive the same fragment throughHARNESS_CLAUDE_SDK_SETTINGS_OVERLAY, applied inClaudeSDKExecutoralongsideapiKeyHelper.Reviewed by Cursor Bugbot for commit 13a28f5. Configure here.