Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
295b10b
fix(#8192): read mint_url from config.yaml/config.base.yaml in fullse…
mfrancisc Oct 13, 2026
273f9aa
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 15, 2026
4fcebc0
fix(#8192): honor config.base.yaml-only mint_url in status notifier
mfrancisc Oct 15, 2026
19776ff
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 15, 2026
1a2084b
fix(#8192): fail-closed mint_url precedence for local runs and reconc…
mfrancisc Oct 15, 2026
87f47a0
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 20, 2026
87b1064
docs(#8192): clarify mint_url OIDC downgrade only applies to run's ag…
mfrancisc Oct 20, 2026
e569e49
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 20, 2026
bd18203
fix(#8192): narrow mint_url OIDC downgrade to genuine local runs
mfrancisc Oct 20, 2026
af52260
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 21, 2026
9b3d06c
docs(#8400): correct mint_url row for the prioritize live-dispatch ef…
mfrancisc Oct 21, 2026
1cc4934
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 21, 2026
40fa0a8
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 21, 2026
ca8412c
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 21, 2026
122e21d
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 21, 2026
20786da
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 23, 2026
ff16a0b
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 26, 2026
29713b0
fix(#8192): restore statusForgeClient arg dropped by merge conflict
mfrancisc Oct 26, 2026
f5ccbb9
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 27, 2026
bfe5f05
Merge branch 'main' into fix/8192-mint-url-config-layering
mfrancisc Oct 28, 2026
55e3e75
fix(cli): resolve mint_url via layered precedence in cancellation fin…
mfrancisc Oct 28, 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
2 changes: 1 addition & 1 deletion docs/contributing/config-source-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The Go accessor layers these. The bash steps in `.github/workflows/reusable-disp
| `runtime`, and per-agent `agents[].runtime` | Which runtime runs (`claude`, `pi`, `codex`, `dummy`) | `--runtime`, `FULLSEND_RUNTIME` (repository variable copied by `setup-agent-env.sh`), agent entry, repo `runtime:`, compiled `claude` | Flag, then `FULLSEND_RUNTIME`, then the agent entry, then repo `runtime:`, then `claude` (`docs/cli/run.md`) | `fullsend run` | File should win. Flag stays first. `FULLSEND_RUNTIME` stays as the fallback | Yes, for the fleet default. |
| `agents[].model` | Model for one agent | `--model`, `FULLSEND_MODEL`, then `FULLSEND_PI_MODEL` or `FULLSEND_CODEX_MODEL` when that runtime is selected, agent entry, harness, frontmatter | Flag, then `FULLSEND_MODEL`, then the runtime-scoped alias, then the agent entry | `fullsend run` | File should win. Same fallback rule | The shared default can live on the base-file agent entry. |
| `agents[].effort` | Effort for one agent | `--effort`, `FULLSEND_EFFORT`, agent entry, harness | Flag, then `FULLSEND_EFFORT`, then the agent entry | `fullsend run` | File should win. Same fallback rule | Same as model. |
| `mint_url` | Token mint address | `--mint-url`, `FULLSEND_MINT_URL`, layered `mint_url`, compiled `https://mint.fullsend.sh` | On `fullsend run`: flag, then `FULLSEND_MINT_URL`. The accessor is not consulted on that path. Workflows pass `vars.FULLSEND_MINT_URL` in as the `mint-url` input, so the flag is set | `fullsend run`, mint-token action. GitLab jobs never mint; `forgePlatform == "gitlab"` skips that path throughout `run.go`, and the GitLab scaffold has no mint reference | File should win once the binary reads `mint_url` before the variable. The workflow must keep passing `mint-url` until old binaries read the file. Setup already copies the effective file value into `FULLSEND_MINT_URL` | Yes. |
| `mint_url` | Token mint address | `--mint-url`, `FULLSEND_MINT_URL`, layered `mint_url`, compiled `https://mint.fullsend.sh` | `fullsend run` and `reconcile-status --fullsend-dir`: flag, then layered `mint_url`, then `FULLSEND_MINT_URL` (`resolveMintURL`, #8400). Only `runAgent`'s agent-token mint downgrades a file-sourced value to warn-and-skip (ambient `GH_TOKEN`) when GitHub Actions OIDC is unavailable; `reconcile-status` and the status-comment mint still attempt it and fail — fail-closed for `reconcile-status`, a per-call warning for status comments. `mint token` has no `--fullsend-dir`, so it stays flag then env | `fullsend run`, `reconcile-status`, `mint token`. GitLab never mints | File should win: done for `run` and `reconcile-status`. This has a live effect today, not only a future one: `action.yml` (`MINT_FLAGS`) omits `--mint-url` entirely when the composite action's `mint_url` input is empty, rather than passing an empty value, and the `prioritize` paths (`reusable-prioritize.yml` and the inlined `prioritize` job in `reusable-dispatch.yml`) have no upfront mint-token step gating on `FULLSEND_MINT_URL` the way triage/code/review/fix/retro/harness-run do. So when that repository variable is unset, those two paths (and any other composite-action caller that leaves `mint-url` empty) already mint — and notify — from a file-only `mint_url` inside real GitHub Actions runs with working OIDC. Every other dispatched stage still passes `mint-url` built from the possibly-stale variable, so the flag wins there until the `route` job computes the value from the file itself. `mint token` stays flag-then-env; it has no directory to layer from. The OIDC downgrade should extend to `reconcile-status` and status comments for consistency — tracked, not yet done. Confirming the mint endpoint serves the `prioritize` role wherever `mint_url` is file-only is tracked, not yet done (#8400 review) | Yes. |
| `inference.region` | GCP region for inference | Layered `inference.region`, compiled `global`. Workflows pass `vars.FULLSEND_GCP_REGION` as `gcp_region`, which becomes `CLOUD_ML_REGION`. GitLab `run-agent-job.sh` exports `CLOUD_ML_REGION` from `FULLSEND_GCP_REGION` | The job environment, not the file. Setup writes the file's effective region into `FULLSEND_GCP_REGION` at install time. A later edit to the file does not change the variable | Vertex client via `CLOUD_ML_REGION`. The accessor is used at install and converge | File should win for the binary. Keep `FULLSEND_GCP_REGION` as the fallback and as the value old workflows still pass | Yes. |
| `inference.project` | GCP project for inference | Layered `inference.project` (no compiled default), secret `FULLSEND_GCP_PROJECT_ID` | The secret. Workflows export it as `ANTHROPIC_VERTEX_PROJECT_ID`. `setup-gcp` uses the same secret to authenticate before the binary runs | Google auth action and the Vertex client | Leave the secret for the auth action. The file should be what the binary reads, with the secret as fallback. Do not put the secret value only in git if the auth action still needs it | Yes for the project id the binary uses. The secret remains for the auth action. |
| `inference.wif_provider` | Workload Identity provider resource name | Layered `inference.wif_provider` (no compiled default), secret `FULLSEND_GCP_WIF_PROVIDER` | The secret. `setup-gcp` reads it | Google auth action | Leave the secret for the auth action. The file should describe the provider the binary needs. Same split as the project id | Yes for the non-secret resource name. The credential material stays a secret. |
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/dev/cli-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fullsend
│ ├── --run-url <url> # CI/CD run URL for status comments
│ ├── --status-repo <owner/repo> # Repository for status comments
│ ├── --status-number <int> # Issue/PR number for status comments
│ └── --mint-url <url> # Mint service URL for on-demand status tokens
│ └── --mint-url <url> # Mint service URL for agent and status tokens (default: layered mint_url, then $FULLSEND_MINT_URL)
├── fetch-skill <url> # Fetch a skill at runtime (in-sandbox)
├── scan # Run security scanner on input/output
│ ├── input # Scan event payload for prompt injection
Expand Down Expand Up @@ -213,10 +213,10 @@ fullsend
├── --run-url <url> # Workflow run URL (optional)
├── --sha <string> # Commit SHA (optional)
├── --reason <string> # Termination reason: terminated or cancelled (default: terminated)
├── --mint-url <url> # Mint service URL for on-demand token (default: $FULLSEND_MINT_URL)
├── --role <string> # Agent role for minting (required with --mint-url)
├── --mint-url <url> # Mint service URL for on-demand token (default: layered mint_url from --fullsend-dir, then $FULLSEND_MINT_URL)
├── --role <string> # Agent role for minting (required to mint a token)
├── --forge <platform> # Forge platform (github, gitlab); auto-detected from CI env
├── --fullsend-dir <path> # Path to fullsend config directory (completion mode detection and tracker routing)
├── --fullsend-dir <path> # Path to fullsend config directory (completion mode detection, layered mint_url resolution, and tracker routing)
├── --job-status <string> # Job outcome from CI runner (e.g. success, failure, cancelled)
├── --was-skipped # Pre-script decided to skip the run; forces synthesis under on_failure
└── --review-run # Built-in GitHub review agent; enables current-HEAD-aware cancellation guidance
Expand Down
8 changes: 5 additions & 3 deletions docs/guides/user/bring-your-own-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ sequenceDiagram
The dispatch workflow matches the comment against the `trigger:` of every
registered harness and starts `fullsend run` for each match. `fullsend run`
gets a short-lived GitHub token for the harness's `role:` from the mint (a
local run without `--mint-url` or `FULLSEND_MINT_URL` skips this and uses
your `GH_TOKEN`), sets up the providers on the OpenShell gateway, and starts
the sandbox. For GitHub and OpenAI the agent never holds a real credential:
local run with no mint URL from `--mint-url`, `config.yaml`/`config.base.yaml`,
or `FULLSEND_MINT_URL` — or where GitHub Actions OIDC isn't available —
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
skips this and uses your `GH_TOKEN`), sets up the providers on the OpenShell
gateway, and starts the sandbox. For GitHub and OpenAI the agent never holds
a real credential:
the gateway gives it a placeholder and swaps in the real value on each
request a declared provider covers. On the Vertex route the GCP credentials
file is copied into the sandbox, and the model calls use it directly. After
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/user/running-agents-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ target issue/PR. These flags mirror what the CI workflows pass automatically:
| `--run-url` | URL of the CI/CD run shown in the status comment |
| `--status-repo` | Repository (`owner/repo`) to post status comments on |
| `--status-number` | Issue or PR number for status comments |
| `--mint-url` | Mint service URL for on-demand status comment tokens (default: `$FULLSEND_MINT_URL`) |
| `--mint-url` | Mint service URL for on-demand status comment tokens (default: layered `mint_url` from `--fullsend-dir`, then `$FULLSEND_MINT_URL`) |
| `--forge` | Forge platform (`github` or `gitlab`); when omitted, resolved from `forge:` in the `config.yaml` at the root of `--fullsend-dir`, then `GITHUB_ACTIONS`/`GITLAB_CI` |

Example:
Expand Down
21 changes: 21 additions & 0 deletions internal/cli/orgconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ func tryLoadFullsendConfig(path string, printer *ui.Printer) config.ConfigWriter
// tryLoadOrgConfig is an alias of tryLoadFullsendConfig (best-effort).
var tryLoadOrgConfig = tryLoadFullsendConfig

// tryLoadLayeredFullsendConfig attempts to load the layered fullsend
// config (config.yaml over config.base.yaml) from fullsendDir.
// Unlike tryLoadFullsendConfig, it does not require config.yaml to
// exist on disk: a base-only layout (config.base.yaml present,
// config.yaml absent) is honored, matching loadLockConfig's semantics.
// Returns nil without error when neither layer exists, or when the
// config is malformed (best-effort, with a warning printed via
// printer in the malformed case). The returned ConfigWriter has
// ensured defaults.
func tryLoadLayeredFullsendConfig(fullsendDir string, printer *ui.Printer) config.ConfigWriter {
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
writer, err := config.LoadConfigWriter(fullsendDir, config.LoadOpts{MissingOK: false})
if err != nil {
if !errors.Is(err, os.ErrNotExist) {
printer.StepWarn("Config malformed (remote resource allowlist unavailable): " + err.Error())
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
}
return nil
}
writer.SetAllowedRemoteResources(config.EnsureDefaultAllowedRemoteResources(writer.AllowedResources()))
return writer
}

// requireFullsendConfig loads a .fullsend config.yaml from the
// given path with strict error handling. Returns differentiated errors
// for missing files, unreadable files, and parse failures.
Expand Down
70 changes: 40 additions & 30 deletions internal/cli/reconcilestatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@ finalized, this is a no-op.`,
return fmt.Errorf("--number must be a positive integer, got %d", number)
}

// Loaded once, before mint-URL resolution and completion-mode
// lookup below, so both consult the same layered config.yaml/
// config.base.yaml snapshot. orgCfg stays nil when
// --fullsend-dir was not provided or the config failed to
// load; downstream readers treat that as "no file layer".
var orgCfg config.ConfigReader
completionMode := ""
if fullsendDir != "" {
writer, err := config.LoadConfigWriter(fullsendDir, config.LoadOpts{MissingOK: true})
switch {
case err != nil:
fmt.Fprintf(os.Stderr, "WARNING: could not load config from %s: %v; using default completion mode\n", fullsendDir, err)
default:
orgCfg = writer
// ConfigWriter embeds StatusNotificationsReader (via
// ConfigReader) directly, so no type assertion is
// needed.
if sn := writer.StatusNotifications(); sn != nil {
completionMode = sn.Comment.Completion
} else {
fmt.Fprintf(os.Stderr, "WARNING: no status_notifications configured at %s; using default completion mode\n", fullsendDir)
}
}
}

if trackerSource == "jira" {
var jErr error
tc, jErr = reconcileNewJiraTrackerClient()
Expand Down Expand Up @@ -125,7 +150,7 @@ finalized, this is a no-op.`,
}
} else {
var githubErr error
statusForgeClient, githubErr = reconcileGitHubClient(cmd, mintURL, role, repoName)
statusForgeClient, githubErr = reconcileGitHubClient(cmd, mintURL, role, repoName, orgCfg)
if githubErr != nil {
return githubErr
}
Expand All @@ -143,31 +168,12 @@ finalized, this is a no-op.`,
termReason = statuscomment.ReasonTerminated
}

completionMode := ""
if fullsendDir != "" {
writer, err := config.LoadConfigWriter(fullsendDir, config.LoadOpts{MissingOK: true})
switch {
case err != nil:
fmt.Fprintf(os.Stderr, "WARNING: could not load config from %s: %v; using default completion mode\n", fullsendDir, err)
default:
// ConfigWriter embeds StatusNotificationsReader (via
// ConfigReader) directly, so no type assertion is
// needed.
if sn := writer.StatusNotifications(); sn != nil {
completionMode = sn.Comment.Completion
} else {
fmt.Fprintf(os.Stderr, "WARNING: no status_notifications configured at %s; using default completion mode\n", fullsendDir)
}
}
}

agentDescription := titleCase(strings.ReplaceAll(role, "-", " "))
guidance := ""
if reviewRun && termReason == statuscomment.ReasonCancelled {
var guidanceErr error
guidance, guidanceErr = resolveBuiltInGitHubReviewCancellationGuidance(
cmd.Context(), statusForgeClient, "review", forgePlatform, trackerSource,
project, number, sha,
cmd.Context(), statusForgeClient, "review", forgePlatform, trackerSource, project, number, sha,
)
if guidanceErr != nil {
fmt.Fprintf(os.Stderr, "WARNING: could not determine whether cancelled review was superseded; omitting retry guidance: %v\n", guidanceErr)
Expand All @@ -185,10 +191,10 @@ finalized, this is a no-op.`,
cmd.Flags().StringVar(&runURL, "run-url", "", "URL to the workflow run (optional)")
cmd.Flags().StringVar(&sha, "sha", "", "commit SHA (optional, shown as short hash)")
cmd.Flags().StringVar(&reason, "reason", "terminated", "termination reason: terminated or cancelled")
cmd.Flags().StringVar(&mintURL, "mint-url", "", "mint service URL for on-demand token (default: $FULLSEND_MINT_URL)")
cmd.Flags().StringVar(&role, "role", "", "agent role for minting (required with --mint-url)")
cmd.Flags().StringVar(&mintURL, "mint-url", "", "mint service URL for on-demand token (default: layered mint_url from --fullsend-dir, then $FULLSEND_MINT_URL)")
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
cmd.Flags().StringVar(&role, "role", "", "agent role for minting (required to mint a token)")
cmd.Flags().StringVar(&forgeFlag, "forge", "", `forge platform (e.g. "github", "gitlab"); auto-detected from CI env vars when omitted`)
cmd.Flags().StringVar(&fullsendDir, "fullsend-dir", "", "path to fullsend config directory (used to detect completion mode and read normalized event for tracker routing)")
cmd.Flags().StringVar(&fullsendDir, "fullsend-dir", "", "path to fullsend config directory (used to detect completion mode, resolve a layered mint_url, and read normalized event for tracker routing)")
cmd.Flags().StringVar(&jobStatus, "job-status", "", "job outcome from the CI runner (e.g. success, failure, cancelled)")
cmd.Flags().BoolVar(&wasSkipped, "was-skipped", false, "whether the pre-script decided to skip the run (forces synthesis under on_failure even when --job-status is success)")
cmd.Flags().BoolVar(&reviewRun, "review-run", false, "whether this is the built-in GitHub review agent (enables GitHub-specific cancellation guidance)")
Expand All @@ -198,16 +204,20 @@ finalized, this is a no-op.`,
}

// reconcileGitHubClient mints a GitHub token and returns a forge client.
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
func reconcileGitHubClient(cmd *cobra.Command, mintURL, role, repoName string) (forge.Client, error) {
if mintURL == "" {
mintURL = os.Getenv("FULLSEND_MINT_URL")
}
// mintURL resolution mirrors fullsend run's precedence (flag > layered
// config.yaml/config.base.yaml mint_url > FULLSEND_MINT_URL) so that
// reconcile-status agrees with run on which mint endpoint to use when both
// are invoked with the same --fullsend-dir in the same CI job (#8400).
// orgCfg may be nil when --fullsend-dir was not provided or its config
// failed to load; resolveMintURL treats that the same as "no file layer".
func reconcileGitHubClient(cmd *cobra.Command, mintURL, role, repoName string, orgCfg config.ConfigReader) (forge.Client, error) {
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
mintURL, _ = resolveMintURL(mintURL, orgCfg, os.Getenv)
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved

if mintURL == "" {
return nil, fmt.Errorf("--mint-url or FULLSEND_MINT_URL required")
return nil, fmt.Errorf("--mint-url, a layered mint_url in config.yaml/config.base.yaml, or FULLSEND_MINT_URL required")
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
Comment thread
rh-hemartin marked this conversation as resolved.
Resolved
}
if role == "" {
return nil, fmt.Errorf("--role is required when using --mint-url")
return nil, fmt.Errorf("--role is required to mint a token")
}
result, err := reconcileMintToken(cmd.Context(), mintclient.MintRequest{
MintURL: mintURL,
Expand Down
Loading
Loading