mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 05:02:14 +00:00
Merge pull request #923 from aliou/fix-alt-up-compaction-queue
fix(coding-agent): restore compaction-queued messages on Alt-Up
This commit is contained in:
commit
5ffe51b38b
2 changed files with 39 additions and 9 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
- Auto-retry now handles "terminated" errors from Codex API mid-stream failures
|
- Auto-retry now handles "terminated" errors from Codex API mid-stream failures
|
||||||
- Follow-up queue (Alt+Enter) now sends full paste content instead of `[paste #N ...]` markers ([#912](https://github.com/badlogic/pi-mono/issues/912))
|
- Follow-up queue (Alt+Enter) now sends full paste content instead of `[paste #N ...]` markers ([#912](https://github.com/badlogic/pi-mono/issues/912))
|
||||||
|
- Fixed Alt-Up not restoring messages queued during compaction ([#923](https://github.com/badlogic/pi-mono/pull/923) by [@aliou](https://github.com/aliou))
|
||||||
|
|
||||||
## [0.49.3] - 2026-01-22
|
## [0.49.3] - 2026-01-22
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2440,16 +2440,45 @@ export class InteractiveMode {
|
||||||
this.ui.requestRender();
|
this.ui.requestRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
private updatePendingMessagesDisplay(): void {
|
/**
|
||||||
this.pendingMessagesContainer.clear();
|
* Get all queued messages (read-only).
|
||||||
const steeringMessages = [
|
* Combines session queue and compaction queue.
|
||||||
|
*/
|
||||||
|
private getAllQueuedMessages(): { steering: string[]; followUp: string[] } {
|
||||||
|
return {
|
||||||
|
steering: [
|
||||||
...this.session.getSteeringMessages(),
|
...this.session.getSteeringMessages(),
|
||||||
...this.compactionQueuedMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text),
|
...this.compactionQueuedMessages.filter((msg) => msg.mode === "steer").map((msg) => msg.text),
|
||||||
];
|
],
|
||||||
const followUpMessages = [
|
followUp: [
|
||||||
...this.session.getFollowUpMessages(),
|
...this.session.getFollowUpMessages(),
|
||||||
...this.compactionQueuedMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text),
|
...this.compactionQueuedMessages.filter((msg) => msg.mode === "followUp").map((msg) => msg.text),
|
||||||
];
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all queued messages and return their contents.
|
||||||
|
* Clears both session queue and compaction queue.
|
||||||
|
*/
|
||||||
|
private clearAllQueues(): { steering: string[]; followUp: string[] } {
|
||||||
|
const { steering, followUp } = this.session.clearQueue();
|
||||||
|
const compactionSteering = this.compactionQueuedMessages
|
||||||
|
.filter((msg) => msg.mode === "steer")
|
||||||
|
.map((msg) => msg.text);
|
||||||
|
const compactionFollowUp = this.compactionQueuedMessages
|
||||||
|
.filter((msg) => msg.mode === "followUp")
|
||||||
|
.map((msg) => msg.text);
|
||||||
|
this.compactionQueuedMessages = [];
|
||||||
|
return {
|
||||||
|
steering: [...steering, ...compactionSteering],
|
||||||
|
followUp: [...followUp, ...compactionFollowUp],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private updatePendingMessagesDisplay(): void {
|
||||||
|
this.pendingMessagesContainer.clear();
|
||||||
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
||||||
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
||||||
this.pendingMessagesContainer.addChild(new Spacer(1));
|
this.pendingMessagesContainer.addChild(new Spacer(1));
|
||||||
for (const message of steeringMessages) {
|
for (const message of steeringMessages) {
|
||||||
|
|
@ -2467,7 +2496,7 @@ export class InteractiveMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
private restoreQueuedMessagesToEditor(options?: { abort?: boolean; currentText?: string }): number {
|
private restoreQueuedMessagesToEditor(options?: { abort?: boolean; currentText?: string }): number {
|
||||||
const { steering, followUp } = this.session.clearQueue();
|
const { steering, followUp } = this.clearAllQueues();
|
||||||
const allQueued = [...steering, ...followUp];
|
const allQueued = [...steering, ...followUp];
|
||||||
if (allQueued.length === 0) {
|
if (allQueued.length === 0) {
|
||||||
this.updatePendingMessagesDisplay();
|
this.updatePendingMessagesDisplay();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue