don't show multiple spaces for codex single line start message rendering#857
don't show multiple spaces for codex single line start message rendering#857
Conversation
Entire-Checkpoint: 573a97ec8d2c
There was a problem hiding this comment.
Pull request overview
Updates the session-start hook banner formatting to avoid Codex rendering "\n " indentation as multiple spaces when displayed as a single line, while keeping the existing multi-line banner style for other agents.
Changes:
- Introduces
sessionStartMessage(agentName, emptyRepo)to centralize banner formatting and special-case Codex as a single-line message. - Updates
handleLifecycleSessionStartto use the new helper for both normal and empty-repo banners. - Adds tests to assert Codex uses a single-line banner and non-Codex agents keep the multi-line banner.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
cmd/entire/cli/lifecycle.go |
Refactors session-start banner construction; adds Codex single-line formatting helper. |
cmd/entire/cli/lifecycle_test.go |
Adds assertions for multi-line default banner and new unit tests for Codex single-line banner output. |
| message := sessionStartMessage(ag.Name(), false) | ||
| if repo, err := strategy.OpenRepository(ctx); err == nil && strategy.IsEmptyRepository(repo) { | ||
| message = "\n\nPowered by Entire:\n No commits yet — checkpoints will activate after your first commit." | ||
| message = sessionStartMessage(ag.Name(), true) | ||
| } |
There was a problem hiding this comment.
For Codex, the base session-start banner is now single-line, but handleLifecycleSessionStart can still append the concurrent-sessions notice using \n ...\n ... later in this function. If Codex renders newlines as spaces (as in the PR description), this will reintroduce multiple consecutive spaces in the displayed message. Consider formatting the appended notice differently for Codex (e.g., single-line with normal spaces, or omit the indentation/newlines when ag.Name()==AgentNameCodex).
cmd/entire/cli/lifecycle.go
Outdated
| func sessionStartMessage(agentName agenttypes.AgentName, emptyRepo bool) string { | ||
| if agentName == agent.AgentNameCodex { | ||
| if emptyRepo { | ||
| return "Powered by Entire: No commits yet - checkpoints will activate after your first commit." |
There was a problem hiding this comment.
The Codex empty-repo banner uses an ASCII hyphen (No commits yet - ...) while the non-Codex banner uses an em dash (No commits yet — ...). This makes the user-facing wording inconsistent across agents; consider using the same punctuation/text for both (while keeping Codex single-line).
| return "Powered by Entire: No commits yet - checkpoints will activate after your first commit." | |
| return "Powered by Entire: No commits yet — checkpoints will activate after your first commit." |
| "github.com/entireio/cli/cmd/entire/cli/agent" | ||
| agenttypes "github.com/entireio/cli/cmd/entire/cli/agent/types" | ||
| "github.com/entireio/cli/cmd/entire/cli/logging" |
There was a problem hiding this comment.
The new import aliases agent/types as agenttypes, but the rest of the codebase typically imports this package as types (e.g., cmd/entire/cli/attach.go:15). Consider using the conventional import name here as well unless there's a conflict to avoid.
Entire-Checkpoint: 3790cba265e6
Before:
After:
Note
Low Risk
Low risk: changes only the SessionStart hook message formatting and adds unit tests; no auth, data, or strategy logic is modified.
Overview
Adjusts the SessionStart hook banner to be agent-specific: Codex now receives a single-line
Powered by Entire:message (including the empty-repo warning) to avoid awkward spacing/rendering, while other agents keep the existing multi-line banner.Introduces a small
sessionStartMessagehelper and expands lifecycle tests to assert the Codex vs default formatting behavior.Reviewed by Cursor Bugbot for commit 8df056f. Configure here.