Repository navigation
fix: report standalone brain install in serve status #2482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
cf2104e
chore(release): update manifests (dev) → v4.260519.1
31b241e
fix(db): native genie → autopg/pgserve-v3 migration (embed migrations…
claude caf7041
fix(db): address PR review — gate native-DB to v3 runtime.json, decou…
claude 4087168
Merge pull request #2456 from automagik-dev/fix/native-pgserve-v3-mig…
namastex888 2d95bf3
chore(release): update manifests (dev) → v4.260519.2
23dbfc1
chore(release): update manifests (dev) → v4.260519.3
bca0067
Merge pull request #2459 from automagik-dev/dev
namastex888 9521906
chore(release): update manifests (dev,homolog,stable) → v4.260519.3
4e642f0
chore(release): update manifests (dev) → v4.260520.1
f4ed9bf
chore(release): update manifests (dev) → v4.260520.2
813827f
Merge pull request #2461 from automagik-dev/dev
namastex888 e6b83ce
chore(release): update manifests (dev,homolog,stable) → v4.260520.2
a668285
chore(release): update manifests (dev) → v4.260520.3
455c25a
Merge pull request #2467 from automagik-dev/dev
namastex888 df68018
chore(release): update manifests (dev,homolog,stable) → v4.260520.3
24f4d38
chore(release): update manifests (dev) → v4.260521.1
010c729
chore(release): update manifests (dev) → v4.260522.1
d612c7d
chore(release): update manifests (dev) → v4.260522.2
f1507ae
chore(release): update manifests (dev) → v4.260522.3
453d0cf
chore(release): update manifests (dev) → v4.260522.4
89c2dd3
chore(release): update manifests (dev) → v4.260522.5
0ea1050
chore(release): update manifests (dev) → v4.260522.6
35d378d
Merge pull request #2473 from automagik-dev/dev
namastex888 1d4ab64
chore(release): update manifests (dev,homolog,stable) → v4.260522.6
6824da7
chore(release): update manifests (dev) → v4.260522.7
172c706
chore(release): update manifests (dev) → v4.260522.8
fceb5be
Merge pull request #2475 from automagik-dev/dev
namastex888 4809393
chore(release): update manifests (dev,homolog,stable) → v4.260522.8
b6a1661
chore(release): update manifests (dev) → v4.260522.9
11b7278
Merge pull request #2476 from automagik-dev/dev
namastex888 0a17089
chore(release): update manifests (dev,homolog,stable) → v4.260522.9
c04892a
chore(release): update manifests (dev) → v4.260522.10
47d9c66
chore(release): update manifests (dev) → v4.260522.11
e347ffa
chore(release): update manifests (dev) → v4.260522.12
9f3461c
chore(release): update manifests (dev) → v4.260522.13
c8be701
Merge pull request #2477 from automagik-dev/dev
namastex888 fda69cb
chore(release): update manifests (dev) → v4.260522.14
cf5b728
chore(release): update manifests (dev,homolog,stable) → v4.260522.14
1cecf8f
chore(release): update manifests (dev) → v4.260522.15
64d54aa
chore(release): update manifests (dev) → v4.260522.16
d991ece
Merge pull request #2478 from automagik-dev/dev
namastex888 f061f65
chore(release): update manifests (dev,homolog,stable) → v4.260522.16
967c044
chore(release): update manifests (dev) → v4.260522.17
c088c0f
Merge pull request #2479 from automagik-dev/dev
namastex888 c582083
chore(release): update manifests (dev,homolog,stable) → v4.260522.17
3b8cee4
chore(release): update manifests (dev) → v4.260522.18
112dfc6
chore(release): update manifests (dev) → v4.260522.19
f922d7e
Merge pull request #2480 from automagik-dev/dev
namastex888 8480ae3
chore(release): update manifests (dev,homolog,stable) → v4.260522.19
e24c992
chore(release): update manifests (dev) → v4.260522.20
b2d3c32
Merge pull request #2481 from automagik-dev/dev
namastex888 a52ef64
chore(release): update manifests (dev,homolog,stable) → v4.260522.20
e6decc6
fix: report standalone brain install in serve status
automagik-genie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| { | ||
| "schema_version": 1, | ||
| "channel": "dev", | ||
| "version": "4.260518.5", | ||
| "released_at": "2026-05-18T17:16:33Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5", | ||
| "version": "4.260522.20", | ||
| "released_at": "2026-05-22T20:41:26Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20", | ||
| "platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| { | ||
| "schema_version": 1, | ||
| "channel": "homolog", | ||
| "version": "4.260518.5", | ||
| "released_at": "2026-05-18T17:16:33Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5", | ||
| "version": "4.260522.20", | ||
| "released_at": "2026-05-22T20:41:26Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20", | ||
| "platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| { | ||
| "schema_version": 1, | ||
| "channel": "stable", | ||
| "version": "4.260518.5", | ||
| "released_at": "2026-05-18T17:16:33Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260518.5", | ||
| "version": "4.260522.20", | ||
| "released_at": "2026-05-22T20:41:26Z", | ||
| "tarball_base": "https://github.com/automagik-dev/genie/releases/download/v4.260522.20", | ||
| "platforms": ["linux-x64-glibc", "linux-x64-musl", "linux-arm64", "darwin-arm64"] | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1577,20 +1577,45 @@ function readActiveBrainConfigFile(): ActiveBrainConfigFile | null { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| async function printStandaloneBrainStatus(): Promise<boolean> { | ||||||
| const config = readActiveBrainConfigFile(); | ||||||
| if (!config?.port) return false; | ||||||
| function getStandaloneBrainVersion(): string | null { | ||||||
| try { | ||||||
| const resp = await fetch(`http://127.0.0.1:${config.port}/healthz`); | ||||||
| const result = spawnSync('brain', ['--version'], { encoding: 'utf-8' }); | ||||||
| if (result.status !== 0) return null; | ||||||
| const version = (result.stdout || result.stderr || '').trim().split(/\s+/)[0]; | ||||||
| return version || 'unknown version'; | ||||||
| } catch { | ||||||
| return null; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| interface StandaloneBrainStatusDeps { | ||||||
| readActiveConfig?: () => ActiveBrainConfigFile | null; | ||||||
| getStandaloneVersion?: () => string | null; | ||||||
| fetchImpl?: typeof fetch; | ||||||
| log?: (message: string) => void; | ||||||
| } | ||||||
|
|
||||||
| export async function printStandaloneBrainStatus(deps: StandaloneBrainStatusDeps = {}): Promise<boolean> { | ||||||
| const log = deps.log ?? console.log; | ||||||
| const config = (deps.readActiveConfig ?? readActiveBrainConfigFile)(); | ||||||
| if (!config?.port) { | ||||||
| const version = (deps.getStandaloneVersion ?? getStandaloneBrainVersion)(); | ||||||
| if (!version) return false; | ||||||
| log(` brain: installed standalone (${version}, server not running)`); | ||||||
| return true; | ||||||
| } | ||||||
| try { | ||||||
| const fetchHealth = deps.fetchImpl ?? fetch; | ||||||
| const resp = await fetchHealth(`http://127.0.0.1:${config.port}/healthz`); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a timeout to the health check fetch prevents the 'serve status' command from hanging if the network request to the local brain server takes too long. Hardcoded limits are acceptable here to prevent performance issues.
Suggested change
References
|
||||||
| const label = config.brainSlug ?? config.database ?? `port ${config.port}`; | ||||||
| console.log( | ||||||
| log( | ||||||
| resp.ok | ||||||
| ? ` brain: running (${label}, port ${config.port})` | ||||||
| : ` brain: unhealthy (${label}, status ${resp.status})`, | ||||||
| ); | ||||||
| return true; | ||||||
| } catch { | ||||||
| console.log(` brain: stopped (port ${config.port} unreachable)`); | ||||||
| log(` brain: stopped (port ${config.port} unreachable)`); | ||||||
| return true; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice to include a timeout when spawning external processes to prevent the CLI from hanging indefinitely if the command (e.g., 'brain --version') fails to respond or hangs. Hardcoded limits are acceptable here to prevent performance issues.
References