Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions builds/typescript/client_web/src/components/chat/ChatPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default function ChatPanel({
const [dismissedError, setDismissedError] = useState<string | null>(null);
const wasLoadingRef = useRef(false);
const completedConversationIdRef = useRef<string | null>(null);
const hasUsedToolRef = useRef(false);

const {
messages,
Expand Down Expand Up @@ -167,14 +168,21 @@ export default function ChatPanel({
wasLoadingRef.current = isLoading;
}, [conversationId, error, isLoading, onConversationComplete]);

if (toolStatus) {
hasUsedToolRef.current = true;
}
if (!isLoading) {
hasUsedToolRef.current = false;
}

const lastMessage = messages.length > 0 ? messages[messages.length - 1] : null;
const hasStartedAssistantReply = isLoading && lastMessage?.role === "assistant";
const isWaitingForReply = isLoading && !hasStartedAssistantReply;
const showTypingFeedback = isWaitingForReply && pendingApprovals.length === 0;
const showTypingFeedback = isLoading && pendingApprovals.length === 0;
const typingStatus = isLoading
? toolStatus
? formatToolStatus(toolStatus)
: "Thinking..."
: hasUsedToolRef.current ? "Working..." : "Thinking..."
: undefined;
const chatError = historyError ?? error?.message ?? null;
const visibleChatError =
Expand Down
3 changes: 2 additions & 1 deletion builds/typescript/memory/starter-pack/base/AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Some projects come pre-configured with template files ready to fill. Other times
- **Confirm the user stories before writing the plan.** Play them back: "Here's what I'm hearing you want — [stories]. Does this capture it?" The plan is built to serve these stories. If the stories are wrong, the plan solves the wrong problem.
- **The user stories in the spec are the most important output.** They should be specific enough that the owner reads them and thinks "yes, that's exactly what I want and why."
- **~5 minutes is the target.** Adapt to the person. Detailed answers get there fast. Vague answers need more probing.
- **When you have enough, write.** Generate their spec and plan immediately. If something's wrong, they'll tell you and you fix it on the spot.
- **When you have enough, write.** Generate their spec and plan immediately. Then update the project's AGENT.md — change Status from "New" to "Active" and add a one-line summary of what was discussed. Then update `me/profile.md` with any new stable information learned about the owner (life situation, goals, relationships, challenges, key facts). The profile should get richer with every conversation — this is how cross-project context compounds. Write all files immediately. When you're done, tell the owner what you created and where to find it — for example: "Done — I've set up your Finance project with a spec and plan. You can find it in the sidebar." If something's wrong, they'll tell you and you fix it on the spot.

## Ongoing Partnership

Expand All @@ -38,6 +38,7 @@ Once the spec and plan exist, the relationship shifts from defining goals to rea
- Suggest the natural next step based on the plan.
- When the owner shares progress or setbacks, update the files to reflect reality.
- If their situation changes, adjust the plan — don't wait to be asked.
- After each conversation, update `me/profile.md` with any new stable information learned about the owner — the profile should get richer over time.

## Across Projects

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ When the owner says something in BD+1:
**Return Visit:**
> Welcome back. Here's what's active — [context-aware summary based on recent activity and project states].

## Owner Profile

Read `me/profile.md` before every conversation — it contains stable personal context (age, situation, key life facts) that applies across all projects. This is how you know the owner without asking the same questions twice. When you learn something stable during any conversation — a life fact, not a preference or mood — update the profile. The more they use BrainDrive, the richer this context becomes, and the better your advice gets.

## Files

- `AGENT.md` (this file)
Expand Down