From f4f2f78c6882fbfb666bd80c79b6a411dda012c0 Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Fri, 3 Apr 2026 17:12:43 +0530 Subject: [PATCH] better instructinos --- apps/x/apps/renderer/src/App.tsx | 36 +++++++++++++++++-- .../skills/code-with-agents/skill.ts | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index 419656c3..a7aeb1b7 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { useCallback, useEffect, useState, useRef } from 'react' +import { useCallback, useEffect, useState, useRef, useLayoutEffect } from 'react' import { workspace } from '@x/shared'; import { RunEvent, ListRunsResponse } from '@x/shared/src/runs.js'; import type { LanguageModelUsage, ToolUIPart } from 'ai'; @@ -615,6 +615,36 @@ function ContentHeader({ ) } +/** + * A
 element that auto-scrolls to the bottom as content updates,
+ * but stops auto-scrolling when the user manually scrolls up.
+ */
+function AutoScrollPre({ className, children }: { className?: string; children: React.ReactNode }) {
+  const ref = useRef(null)
+  const stickToBottom = useRef(true)
+
+  useLayoutEffect(() => {
+    const el = ref.current
+    if (el && stickToBottom.current) {
+      el.scrollTop = el.scrollHeight
+    }
+  }, [children])
+
+  const handleScroll = useCallback(() => {
+    const el = ref.current
+    if (!el) return
+    // Consider "at bottom" if within 24px of the bottom edge
+    const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 24
+    stickToBottom.current = atBottom
+  }, [])
+
+  return (
+    
+      {children}
+    
+ ) +} + function App() { type ShortcutPane = 'left' | 'right' type MarkdownHistoryHandlers = { undo: () => boolean; redo: () => boolean } @@ -3871,9 +3901,9 @@ function App() {

Live Output

-
+                
                   {item.streamingOutput}
-                
+ ) : output !== null ? ( diff --git a/apps/x/packages/core/src/application/assistant/skills/code-with-agents/skill.ts b/apps/x/packages/core/src/application/assistant/skills/code-with-agents/skill.ts index 62cd40f8..187c9e3e 100644 --- a/apps/x/packages/core/src/application/assistant/skills/code-with-agents/skill.ts +++ b/apps/x/packages/core/src/application/assistant/skills/code-with-agents/skill.ts @@ -82,7 +82,7 @@ When constructing the prompt for the coding agent: ### Step 4: Report results -After the command finishes, present the coding agent's output directly to the user — do not rephrase, summarize, or add commentary on top of it. The agent's output is the result. Only add your own explanation if something went wrong (e.g. the command failed or the exit code is non-zero). +After the command finishes, look for the summary that the coding agent produced at the end of its output and pass that along to the user as-is. Do not rewrite or add to it. Only add your own explanation if the command failed or the exit code is non-zero. Do NOT use file reference blocks (e.g. \`\`\`file:path/to/file\`\`\`) when mentioning code files — they may not open correctly. Just refer to file paths as plain text.