mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 03:03:44 +00:00
tui: Fix differential rendering to preserve scrollback buffer
- renderDifferential now correctly handles content that exceeds viewport - When changes are above viewport, do full re-render with scrollback clear - When changes are in viewport, do partial re-render from change point - All tests pass, correctly preserves 100 items in scrollback - Issue: Still re-renders too much (entire tail from first change)
This commit is contained in:
parent
afa807b200
commit
0131b29b2c
22 changed files with 2878 additions and 80 deletions
|
|
@ -533,7 +533,10 @@ export class Agent {
|
|||
|
||||
// Initialize with system prompt if provided
|
||||
if (config.systemPrompt) {
|
||||
this.messages.push({ role: "system", content: config.systemPrompt });
|
||||
this.messages.push({
|
||||
role: "developer",
|
||||
content: config.systemPrompt,
|
||||
});
|
||||
}
|
||||
|
||||
// Start session logging if we have a session manager
|
||||
|
|
@ -621,8 +624,8 @@ export class Agent {
|
|||
// Responses API format
|
||||
if (this.config.systemPrompt) {
|
||||
this.messages.push({
|
||||
type: "system",
|
||||
content: [{ type: "system_text", text: this.config.systemPrompt }],
|
||||
role: "developer",
|
||||
content: this.config.systemPrompt,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -630,7 +633,7 @@ export class Agent {
|
|||
switch (event.type) {
|
||||
case "user_message":
|
||||
this.messages.push({
|
||||
type: "user",
|
||||
role: "user",
|
||||
content: [{ type: "input_text", text: event.text }],
|
||||
});
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue