Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3313ef2
🐛 fix: bypass the proxy for the OMP_AUTH_BROKER_URL host in agent NO_…
odttlnt Oct 29, 2026
097a861
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
0a2d57e
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
a309692
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
350f8a0
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
014e925
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
078ff68
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
348ab8b
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
b48725f
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
c0e98a8
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
ed68afd
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
7fd3a6d
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
7200640
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
7d4eaaa
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
7e77e88
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
07b6d60
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
08b4f85
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
dcb12c7
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
8fb13a0
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
99422d8
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
2275124
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
9f84890
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
026cab8
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
f154d44
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
2e4c67d
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
dfe5492
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
22befb4
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
72246f9
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
60c00c7
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
38f552f
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
551c0ae
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
05b6c26
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
10cde53
Merge branch 'v5' into hive/adopt-15433
hivecommons-hive[bot] Oct 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-15432-broker-no-proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Agents now bypass the hive proxy for the host of `OMP_AUTH_BROKER_URL` (added to `NO_PROXY`), so a credential broker on a private address such as the Docker bridge gateway is no longer refused by the plain-forward guard and the agent CLI no longer exits on start ([#15432](https://github.com/hivecommons/hive/issues/15432)).
1 change: 1 addition & 0 deletions src/crux/agent/coverage_boost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ func TestAgentEnvPairs_NonInference_NoProxyLoopback(t *testing.T) {
Config: config.AgentConfig{Backend: "claude", Model: "sonnet"},
}

t.Setenv("OMP_AUTH_BROKER_URL", "")
count := 0
for _, p := range m.agentEnvPairs(ap) {
if p.Key == "NO_PROXY" {
Expand Down
23 changes: 22 additions & 1 deletion src/crux/agent/manager_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package agent
import (
"encoding/json"
"fmt"
"net/url"
"os"
"os/exec"
"path/filepath"
Expand All @@ -16,6 +17,23 @@ import (
"github.com/hivecommons/hive/crux/jev"
)

// agentNoProxy returns the NO_PROXY value handed to agents: loopback plus the
// host of OMP_AUTH_BROKER_URL, and only that host. An unset, unparsable or
// host-less URL adds nothing, so every other private address stays behind the
// proxy's destination guard.
func agentNoProxy() string {
const loopback = "127.0.0.1,localhost,::1"
u, err := url.Parse(strings.TrimSpace(os.Getenv("OMP_AUTH_BROKER_URL")))
if err != nil {
return loopback
}
host := u.Hostname()
if host == "" || strings.ContainsAny(host, ", \t") {
return loopback
}
return loopback + "," + host
}

func (m *Manager) buildBootstrapPrompt(agent *AgentProcess) string {
// No boot prompt — the governor's first eval cycle (10s after startup)
// kicks all due agents via BuildKickMessages with fully substituted
Expand Down Expand Up @@ -253,7 +271,10 @@ func (m *Manager) agentEnvPairs(agent *AgentProcess) []agentEnvPair {
vars = append(vars, agentEnvPair{"HTTP_PROXY", proxyURL, false})
// Loopback must never traverse the hive proxy for any backend: an agent
// polling a local dev server would otherwise get proxy-side dial errors (#14076).
vars = append(vars, agentEnvPair{"NO_PROXY", "127.0.0.1,localhost,::1", false})
// The credential broker (OMP_AUTH_BROKER_URL) usually sits on a private
// address the proxy's plain-forward guard refuses, so its host bypasses
// the proxy too (#15432).
vars = append(vars, agentEnvPair{"NO_PROXY", agentNoProxy(), false})
vars = append(vars, agentEnvPair{"HIVE_PROXY_AGENT", agent.Name, false})
vars = append(vars, agentEnvPair{"GIT_TERMINAL_PROMPT", "0", false})
vars = append(vars, agentEnvPair{"NODE_EXTRA_CA_CERTS", proxyCACertPath, false})
Expand Down
26 changes: 26 additions & 0 deletions src/crux/agent/manager_env_noproxy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package agent

import "testing"

func TestAgentNoProxy(t *testing.T) {
const loop = "127.0.0.1,localhost,::1"
cases := []struct {
name, url, want string
}{
{"unset", "", loop},
{"ipv4 with port", "http://172.18.0.1:18765/v1/snapshot", loop + ",172.18.0.1"},
{"hostname", "http://broker.internal:8080", loop + ",broker.internal"},
{"ipv6 literal", "http://[fd00::1]:18765", loop + ",fd00::1"},
{"invalid", "http://[::1", loop},
{"no host", "/just/a/path", loop},
{"opaque", "mailto:x@y", loop},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Setenv("OMP_AUTH_BROKER_URL", tc.url)
if got := agentNoProxy(); got != tc.want {
t.Errorf("agentNoProxy() = %q, want %q", got, tc.want)
}
})
}
}
Loading