fix(coding-agent): space first user message after notices

closes #3613
This commit is contained in:
Mario Zechner
2026-04-23 22:16:23 +02:00
parent 00cb947166
commit c091aa732f
2 changed files with 2 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
### Fixed ### Fixed
- Fixed first user messages rendering without spacing after existing notices such as compaction summaries or status messages ([#3613](https://github.com/badlogic/pi-mono/issues/3613))
- Fixed the handoff extension example to use the replacement-session context after creating a new session, avoiding stale `ctx` errors when it installs the generated prompt ([#3606](https://github.com/badlogic/pi-mono/issues/3606)) - Fixed the handoff extension example to use the replacement-session context after creating a new session, avoiding stale `ctx` errors when it installs the generated prompt ([#3606](https://github.com/badlogic/pi-mono/issues/3606))
- Fixed session replacement and `/quit` teardown ordering to run host-owned extension UI cleanup synchronously after `session_shutdown` handlers complete but before invalidating the old extension context, preventing stale extension UI from rendering against a disposed session. - Fixed session replacement and `/quit` teardown ordering to run host-owned extension UI cleanup synchronously after `session_shutdown` handlers complete but before invalidating the old extension context, preventing stale extension UI from rendering against a disposed session.
- Fixed crash on `/quit` when an extension registers a custom footer whose `render()` accesses `ctx`, by tearing down extension-provided UI before invalidating the extension runner during shutdown ([#3595](https://github.com/badlogic/pi-mono/issues/3595)) - Fixed crash on `/quit` when an extension registers a custom footer whose `render()` accesses `ctx`, by tearing down extension-provided UI before invalidating the extension runner during shutdown ([#3595](https://github.com/badlogic/pi-mono/issues/3595))

View File

@@ -279,9 +279,6 @@ export class InteractiveMode {
// Tool execution tracking: toolCallId -> component // Tool execution tracking: toolCallId -> component
private pendingTools = new Map<string, ToolExecutionComponent>(); private pendingTools = new Map<string, ToolExecutionComponent>();
// Track first user message to avoid leading spacer at top of chat
private isFirstUserMessage = true;
// Tool output expansion state // Tool output expansion state
private toolOutputExpanded = false; private toolOutputExpanded = false;
@@ -3035,7 +3032,7 @@ export class InteractiveMode {
case "user": { case "user": {
const textContent = this.getUserMessageText(message); const textContent = this.getUserMessageText(message);
if (textContent) { if (textContent) {
if (!this.isFirstUserMessage) { if (this.chatContainer.children.length > 0) {
this.chatContainer.addChild(new Spacer(1)); this.chatContainer.addChild(new Spacer(1));
} }
const skillBlock = parseSkillBlock(textContent); const skillBlock = parseSkillBlock(textContent);
@@ -3059,7 +3056,6 @@ export class InteractiveMode {
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings()); const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings());
this.chatContainer.addChild(userComponent); this.chatContainer.addChild(userComponent);
} }
this.isFirstUserMessage = false;
if (options?.populateHistory) { if (options?.populateHistory) {
this.editor.addToHistory?.(textContent); this.editor.addToHistory?.(textContent);
} }
@@ -3097,7 +3093,6 @@ export class InteractiveMode {
options: { updateFooter?: boolean; populateHistory?: boolean } = {}, options: { updateFooter?: boolean; populateHistory?: boolean } = {},
): void { ): void {
this.pendingTools.clear(); this.pendingTools.clear();
this.isFirstUserMessage = true;
if (options.updateFooter) { if (options.updateFooter) {
this.footer.invalidate(); this.footer.invalidate();