mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 03:01:56 +00:00
Fix branch summarization abort handling and tree navigation
- Check response.stopReason instead of catching errors for abort detection - Return result object from _generateBranchSummary instead of throwing - Fix summary attachment: attach to navigation target position, not old branch - Support root-level summaries (parentId=null) in branchWithSummary - Remove setTimeout hack for re-showing tree selector on abort
This commit is contained in:
parent
9dac0a1423
commit
01dae9ebcc
7 changed files with 55 additions and 40 deletions
|
|
@ -609,8 +609,12 @@ class TreeList implements Component {
|
|||
return `[edit: ${path}]`;
|
||||
}
|
||||
case "bash": {
|
||||
const cmd = String(args.command || "").slice(0, 50);
|
||||
return `[bash: ${cmd}${(args.command as string)?.length > 50 ? "..." : ""}]`;
|
||||
const rawCmd = String(args.command || "");
|
||||
const cmd = rawCmd
|
||||
.replace(/[\n\t]/g, " ")
|
||||
.trim()
|
||||
.slice(0, 50);
|
||||
return `[bash: ${cmd}${rawCmd.length > 50 ? "..." : ""}]`;
|
||||
}
|
||||
case "grep": {
|
||||
const pattern = String(args.pattern || "");
|
||||
|
|
|
|||
|
|
@ -1600,7 +1600,7 @@ export class InteractiveMode {
|
|||
|
||||
private showTreeSelector(): void {
|
||||
const tree = this.sessionManager.getTree();
|
||||
const realLeafId = this.sessionManager.getLeafUuid();
|
||||
const realLeafId = this.sessionManager.getLeafId();
|
||||
|
||||
// Find the visible leaf for display (skip metadata entries like labels)
|
||||
let visibleLeafId = realLeafId;
|
||||
|
|
@ -1660,7 +1660,9 @@ export class InteractiveMode {
|
|||
const result = await this.session.navigateTree(entryId, { summarize: wantsSummary });
|
||||
|
||||
if (result.aborted) {
|
||||
// Summarization aborted - re-show tree selector
|
||||
this.showStatus("Branch summarization cancelled");
|
||||
this.showTreeSelector();
|
||||
return;
|
||||
}
|
||||
if (result.cancelled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue