Skip to content

Fix logTarget to avoid printing prefix when session not found#56

Merged
jancurn merged 1 commit into
mainfrom
claude/fix-session-error-message-uGuYR
Mar 11, 2026
Merged

Fix logTarget to avoid printing prefix when session not found#56
jancurn merged 1 commit into
mainfrom
claude/fix-session-error-message-uGuYR

Conversation

@jancurn

@jancurn jancurn commented Mar 11, 2026

Copy link
Copy Markdown
Member

Summary

Fixed logTarget function to prevent printing a misleading session prefix when a session doesn't exist. Now only the error message is displayed to the user.

Changes

  • Moved the early return statement in logTarget outside the if (session) block so it executes regardless of whether a session is found
  • Added clarifying comment explaining that when a session is not found, the error handler will display the appropriate message
  • This prevents the [→ @name (HTTP)] prefix from being printed when no session exists

Implementation Details

The fix is a simple control flow adjustment: the return statement that was inside the if (session) block (only executing when a session exists) is now placed after the block, ensuring it always executes. This allows the error handling logic downstream to properly display error messages without the misleading session prefix being printed first.

https://claude.ai/code/session_01FLZpnvfdPy6kbPmHcarxEF

When a session doesn't exist, logTarget fell through to the HTTP
fallback path and printed `[→ @name (HTTP)]` before the actual error.
Now it returns early for session targets that aren't found.

https://claude.ai/code/session_01FLZpnvfdPy6kbPmHcarxEF
@jancurn jancurn merged commit 68a7822 into main Mar 11, 2026
6 checks passed
@jancurn jancurn deleted the claude/fix-session-error-message-uGuYR branch March 12, 2026 14:17
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.

3 participants