Skip to content

don't show multiple spaces for codex single line start message rendering#857

Open
Soph wants to merge 2 commits intomainfrom
soph/codex-warning-fix
Open

don't show multiple spaces for codex single line start message rendering#857
Soph wants to merge 2 commits intomainfrom
soph/codex-warning-fix

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 5, 2026

Before:

SessionStart hook (completed)
  warning: Powered by Entire:  This conversation will be linked to your next commit.

After:

SessionStart hook (completed)
  warning: Powered by Entire: This conversation will be linked to your next commit.

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 sessionStartMessage helper and expands lifecycle tests to assert the Codex vs default formatting behavior.

Reviewed by Cursor Bugbot for commit 8df056f. Configure here.

@Soph Soph requested a review from a team as a code owner April 5, 2026 15:29
Copilot AI review requested due to automatic review settings April 5, 2026 15:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 handleLifecycleSessionStart to 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.

Comment on lines +83 to 86
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)
}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
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."
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
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."

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

Comment on lines 20 to 22
"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"
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Entire-Checkpoint: 3790cba265e6
pjbgf
pjbgf previously approved these changes Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants