Skip to content

fix(cli): honor HAPI_HOSTNAME in session metadata#449

Merged
hqhq1025 merged 1 commit intotiann:mainfrom
Shujakuinkuraudo:fix/session-hostname-env
Apr 13, 2026
Merged

fix(cli): honor HAPI_HOSTNAME in session metadata#449
hqhq1025 merged 1 commit intotiann:mainfrom
Shujakuinkuraudo:fix/session-hostname-env

Conversation

@Shujakuinkuraudo
Copy link
Copy Markdown
Contributor

Summary

This small fix makes session metadata use HAPI_HOSTNAME the same way machine metadata already does.

Problem

Today HAPI_HOSTNAME affects machine metadata, but session metadata still records os.hostname() directly.
That can be confusing in self-hosted setups where multiple clients share the same system hostname but are intentionally distinguished with HAPI_HOSTNAME.

Change

  • use process.env.HAPI_HOSTNAME || os.hostname() in buildSessionMetadata()
  • add a focused test covering the env override

Why

This keeps machine host and session host consistent, and improves host-based display / fallback behavior without changing default behavior for users who do not set HAPI_HOSTNAME.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • None.

Summary
Review mode: initial. No diff-introduced correctness, security, regression, or maintainability issues found in the modified lines. Residual risk: this change only adds a focused env-override test, and fallback behavior to os.hostname() was not re-verified in automation here.

Testing

  • Not run (automation): bun is not installed in this runner, so I could not execute cli/src/agent/sessionFactory.test.ts.

HAPI Bot

@hqhq1025 hqhq1025 merged commit fadc0de into tiann:main Apr 13, 2026
2 checks passed
Hwwwww-dev pushed a commit to Hwwwww-dev/hapi that referenced this pull request Apr 17, 2026
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.

2 participants