Skip to content

feat(cli): show forge binary/runtime version on the startup banner (#335)#336

Merged
initializ-mk merged 1 commit into
mainfrom
feat/banner-forge-version-335
Jul 18, 2026
Merged

feat(cli): show forge binary/runtime version on the startup banner (#335)#336
initializ-mk merged 1 commit into
mainfrom
feat/banner-forge-version-335

Conversation

@initializ-mk

Copy link
Copy Markdown
Contributor

Closes #335.

Problem

The startup banner printed the agent's forge.yaml version but never the forge binary running it, so it was hard to tell which runtime (v0.17.0, a vnext/dev build, or a locally-built binary) was executing a deployed agent. The build version already existed (-X main.version / -X main.commit via the Makefile + goreleaser) and was threaded to the runner as RuntimeVersion — it just wasn't shown; commit was baked only into the --version template.

Change

  Agent:      my-agent (v1.2.0)       # agent's forge.yaml version
  Forge:      v0.17.0 (commit: 51df9a4)   # ← NEW: the forge binary/runtime
  Framework:  ...
  • root.go — store commit in appCommit (was discarded after building the version template).
  • run.go — pass RuntimeCommit alongside the existing RuntimeVersion: appVersion.
  • runner.go — add RunnerConfig.RuntimeCommit + a Forge: banner line via forgeVersionString().

Degradation: a dev build / no baked commit shows just the version (dev, v0.17.0); the none sentinel and empty commit suppress the (commit: …) suffix. forge --version output is unchanged.

Verification

  • forgeVersionString() covered by a table test (release+commit, release no-commit, empty commit, dev defaults, empty version → dev, empty version + real commit).
  • Built with -ldflags "-X main.version=v0.17.0 -X main.commit=abc1234"forge --versionforge v0.17.0 (commit: abc1234) (unchanged).
  • Banner line is a single Fprintf inserted right after the existing Agent: line; gofmt + golangci-lint clean, go build ./... green.

#335)

The startup banner printed the AGENT's forge.yaml version but not the
forge binary that's running it, making it hard to tell which runtime
(v0.17.0 / a vnext or dev build / a local build) is executing a deployed
agent. The build version already exists (-X main.version/.commit) and is
threaded to the runner as RuntimeVersion; commit was baked only into the
--version template.

- root.go: store commit in appCommit (was discarded after the template).
- run.go: pass RuntimeCommit alongside RuntimeVersion.
- runner.go: add RunnerConfig.RuntimeCommit + a 'Forge:' banner line via
  forgeVersionString() — 'v0.17.0 (commit: 51df9a4)', degrading to just
  the version for dev builds / no baked commit.

  Agent:      my-agent (v1.2.0)     # agent's forge.yaml version
  Forge:      v0.17.0 (commit: …)   # the forge binary — new

--version output is unchanged. forgeVersionString covered by a table test.
@initializ-mk
initializ-mk merged commit 2637bd5 into main Jul 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Startup banner: print the forge binary/runtime version (and commit)

1 participant