fix: render hapi relay url on demand - #87
Conversation
|
@claude @codex review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 3m 2s —— View job Code Review — PR #87
SummaryThe approach is sound and solves the race condition cleanly. Two real issues worth fixing before merge, one low-severity note. 1. Unbounded
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92760af095
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def load_runtime_hapi_url(server_log_file, settings_file): | ||
| """Read live hapi runtime files and build the dashboard URL if available.""" | ||
| try: | ||
| server_log_text = Path(server_log_file).read_text(encoding="utf-8", errors="replace") |
There was a problem hiding this comment.
Bound relay log reads on dashboard loads
In long-lived containers where /home/hapi/.hapi/server.log grows because the entrypoint continuously tees hapi server --relay output there, every authenticated dashboard request now reads the entire log and then scans all matches before rendering the menu. A large log can stall or OOM the proxy, making the dashboard/terminals unavailable; read only a bounded tail or cache the discovered relay URL instead of loading the full file on each request.
Useful? React with 👍 / 👎.
|
Addressed the confirmed review findings in e807c46:
Claude note #3 about the dead Validation after the fixes:
Note: full |
|
@claude @codex review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 43s —— View job Code Review — PR #87
|
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

Summary
server.logrelay URL +settings.jsoncliApiToken./home/hapi/urlas a compatibility fallback only while thehapibinary is available, so headlessINSTALL_HAPI=falsedeployments do not resurrect stale links from a persisted volume.Approach
Chose variant A from the brief: runtime render in the menu request path. This removes the race with the entrypoint's one-shot 60s URL writer because the dashboard no longer depends on that file being created at startup.
Environment
No new or changed environment variables.
Validation
python -m pytest tests/(356 passed)docker build -t clihost:hapi-url-race-64 ./healthreturned ok,sshdstayed running, and the runtime URL builder worked inside the built image.Closes #64