Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

better logging

Theo Browne2f4051ed308d
diff --git a/.gitignore b/.gitignore
index 9fc5e0bee..701ad4089 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ packages/*/dist
.env
.env.local
build/
+.logs/
diff --git a/apps/desktop/src/providerManager.ts b/apps/desktop/src/providerManager.ts
index 2a9f37bcb..0700daa65 100644
--- a/apps/desktop/src/providerManager.ts
+++ b/apps/desktop/src/providerManager.ts
@@ -1,4 +1,6 @@
import { EventEmitter } from "node:events";
+import fs from "node:fs";
+import path from "node:path";
import {
type ProviderEvent,
@@ -21,10 +23,22 @@ export interface ProviderManagerEvents {
export class ProviderManager extends EventEmitter<ProviderManagerEvents> {
private readonly codex = new CodexAppServerManager();
+ private readonly logStream: fs.WriteStream;
constructor() {
super();
- this.codex.on("event", (event) => this.emit("event", event));
+
+ const logsDir = path.resolve(process.cwd(), ".logs");
+ fs.mkdirSync(logsDir, { recursive: true });
+ this.logStream = fs.createWriteStream(
+ path.join(logsDir, "events.txt"),
+ { flags: "a" },
+ );
+
+ this.codex.on("event", (event) => {
+ this.logStream.write(`${JSON.stringify(event)}\n`);
+ this.emit("event", event);
+ });
}
async startSession(raw: ProviderSessionStartInput): Promise<ProviderSession> {
diff --git a/apps/renderer/src/components/ChatView.tsx b/apps/renderer/src/components/ChatView.tsx
index 38c2bc784..444cf8c88 100644
--- a/apps/renderer/src/components/ChatView.tsx
+++ b/apps/renderer/src/components/ChatView.tsx
@@ -36,10 +36,10 @@ function statusLabel(phase: string): string {
}
function workToneClass(tone: "thinking" | "tool" | "info" | "error"): string {
- if (tone === "thinking") return "text-sky-100";
- if (tone === "tool") return "text-emerald-100";
- if (tone === "error") return "text-rose-100";
- return "text-[#d8d8d8]";
+ if (tone === "error") return "text-rose-300/50";
+ if (tone === "tool") return "text-[#8a8a8a]";
+ if (tone === "thinking") return "text-[#707070]";
+ return "text-[#606060]";
}
export default function ChatView() {
@@ -341,53 +341,6 @@ export default function ChatView() {
</div>
) : (
<div className="mx-auto max-w-3xl space-y-4">
- {isWorking && (
- <div className="rounded-2xl border border-sky-400/20 bg-sky-500/[0.06] px-3 py-2.5">
- <div className="flex items-center justify-between gap-2">
- <div className="inline-flex items-center gap-2 text-xs text-sky-100">
- <span className="relative inline-flex h-2.5 w-2.5">
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-300/70" />
- <span className="relative inline-flex h-2.5 w-2.5 rounded-full bg-sky-200" />
- </span>
- <span>Model is working</span>
- </div>
- <span className="text-[10px] text-sky-100/70">
- {recentWorkLogEntries.length} event
- {recentWorkLogEntries.length === 1 ? "" : "s"}
- </span>
- </div>
- {recentWorkLogEntries.length === 0 ? (
- <p className="pt-2 text-[11px] text-sky-100/70">
- Waiting for tool/preamble updates...
- </p>
- ) : (
- <div className="mt-2 max-h-48 space-y-1.5 overflow-y-auto pr-1">
- {recentWorkLogEntries.map((entry) => (
- <div
- key={entry.id}
- className="rounded-lg border border-white/[0.08] bg-black/20 px-2 py-1.5"
- >
- <div className="flex items-start justify-between gap-2">
- <p
- className={`text-[11px] ${workToneClass(entry.tone)}`}
- >
- {entry.label}
- </p>
- <span className="shrink-0 text-[10px] text-[#a0a0a0]/60">
- {formatTimestamp(entry.createdAt)}
- </span>
- </div>
- {entry.detail && (
- <p className="pt-0.5 font-mono text-[11px] text-[#d0d0d0]/75">
- {entry.detail}
- </p>
- )}
- </div>
- ))}
- </div>
- )}
- </div>
- )}
{activeThread.messages.map((msg) => (
<div key={msg.id}>
{msg.role === "user" ? (
@@ -433,6 +386,35 @@ export default function ChatView() {
)}
</div>
))}
+ {/* Inline activity feed */}
+ {isWorking && (
+ <div className="border-l-2 border-white/[0.05] pl-4 py-1">
+ {recentWorkLogEntries.map((entry) => (
+ <p
+ key={entry.id}
+ className={`py-[2px] text-[12px] leading-relaxed ${workToneClass(entry.tone)}`}
+ >
+ {entry.detail ? (
+ <>
+ {entry.label}
+ <span className="ml-1.5 font-mono text-[11px] opacity-60">
+ {entry.detail}
+ </span>
+ </>
+ ) : (
+ entry.label
+ )}
+ </p>
+ ))}
+ <div className="flex items-center pt-1">
+ <span className="inline-flex items-center gap-[3px]">
+ <span className="h-1 w-1 rounded-full bg-white/20 animate-pulse" />
+ <span className="h-1 w-1 rounded-full bg-white/20 animate-pulse [animation-delay:200ms]" />
+ <span className="h-1 w-1 rounded-full bg-white/20 animate-pulse [animation-delay:400ms]" />
+ </span>
+ </div>
+ </div>
+ )}
<div ref={messagesEndRef} />
</div>
)}
diff --git a/bun.lock b/bun.lock
index 046e58cfc..c07bf700d 100644
--- a/bun.lock
+++ b/bun.lock
@@ -42,6 +42,7 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.4",
+ "babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
"tailwindcss": "^4.0.0",
"typescript": "^5.7.3",
"vite": "^6.0.5",
@@ -368,6 +369,8 @@
"axios": ["[email protected]", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg=="],
+ "babel-plugin-react-compiler": ["[email protected]", "", { "dependencies": { "@babel/types": "^7.26.0" } }, "sha512-q84bNR9JG1crykAlJUt5Ud0/5BUyMFuQww/mrwIQDFBaxsikqBDj3f/FNDsVd2iR26A1HvXKWPEIfgJDv8/V2g=="],
+
"balanced-match": ["[email protected]", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],