feat: add agent-network (AI gateway) management - #2
Draft
RollLikeRollo wants to merge 24 commits into
Draft
Conversation
RollLikeRollo
marked this pull request as draft
August 11, 2026 10:18
feat: add reverse-proxy services and custom domain management
…API IDs in every new diff mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ever validated before the mutation boundary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…all AN modules Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cleanup, and service fetches are inconsistent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…xports that look like a clean account. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s. Preserve defined values during export. Serialize all dynamic strings with to_json.
RollLikeRollo
force-pushed
the
agent-network
branch
from
August 24, 2026 13:26
87d9ddc to
07639c1
Compare
The target normalization used a global des_keys set (union of all keys from all desired targets) to filter API targets. When one target declared skip_tls_verify and another didn't, the API's default value on the second target leaked into the comparison — false positive. Match each current target to its desired counterpart by (target_id, port) and filter to only that target's declared keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify all four AN resource types (an_provider, an_policy, an_guardrail, an_budget_rule) dispatch to their compare functions and detect real changes. Covers provider_id→catalog_provider_id normalization, api_key exclusion, and group name resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two issues with netbird_an_settings against real instances:
1. Older builds return null from GET for uninitialised accounts,
causing AttributeError on settings_need_update(). Guard with
current_settings = current_settings or {}.
2. Current builds require POST to bootstrap the settings row before
PUT can update it, and PUT must echo the immutable endpoint field.
Add proxy_address/endpoint params, POST when not bootstrapped,
echo endpoint in PUT body, and fail with a clear message when
bootstrap params are missing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The export template dumped raw API IDs for destination_provider_ids and guardrail_ids in AN policies, but the configure role's pre-flight and resolver treat those fields as name-based. A freshly exported config failed its own pre-flight validation. Build an_provider_id_map and an_guardrail_id_map in the export role and resolve IDs to names with the same undef(hint=...) pattern used for source_groups. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two causes of spurious CHANGED in preview for AN resources: 1. _AN_SKIP and _AN_PROVIDER_SKIP did not include 'state', so every exported AN resource showed state: + added. 2. _compare_an_resource did not resolve provider/guardrail names to IDs, so once export writes names (previous commit), every AN policy with destination_provider_ids or guardrail_ids showed as changed. Add provider_ids/guardrail_ids params and pass them from the preview and dispatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The export role now fetches AN settings (with ignore_errors for older builds) and writes the four mutable fields (enable_log_collection, enable_prompt_collection, redact_pii, access_log_retention_days) into the exported config. Unbootstrapped or unavailable settings export as an empty dict, matching the config skeleton. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A null response from GET /api/agent-network/settings (older builds) should set bootstrapped=False so the module attempts POST bootstrap, not just guard against the AttributeError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ettings Current management builds return 200 with a synthesized defaults object (no created_at) from GET /api/agent-network/settings when the account was never bootstrapped, rather than null or 404. The module read that as bootstrapped, so on such accounts a toggle update still hit the raw 404 from the PUT, and proxy_address alone was a silent no-op because the bootstrap path was never reached. Treat a GET response without created_at as non-bootstrapped. With that alone, two legitimate calls would start failing on non-bootstrapped accounts: a bare read-only call, and applying a freshly exported config (the export now includes netbird_an_settings, whose values match the synthesized defaults). Only fail when an update is genuinely needed; otherwise return the current settings unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on netbirdio#62. See PR description for details.