Auto Behaviours
How Fabric Agents helps you stay in flow — prompt enhancement, auto-compact on context overflow, auto-archive of idle sessions, and automatic status transitions.
Fabric Agents tries to keep you in flow. A handful of background behaviours quietly take care of the bits you'd otherwise have to micromanage — rewriting a vague prompt, recovering from a 400 when the conversation runs long, archiving sessions that have gone cold, and moving session status as the conversation moves. Each is opt-in, opt-out, or has a sensible default.
Prompt enhancer (✨)
The wand-icon button in the chat input rewrites your draft into a clearer, more specific prompt before sending. It runs against your current repo context — package.json, top-level layout, detected frameworks, dominant languages, monorepo workspaces — and any identifier-shaped tokens in your draft (file paths, PascalCase types, camelCase functions). Those tokens are grepped against the working directory so the enhanced prompt can reference real files instead of hallucinated ones.
A small context badge beside the wand shows what was attached: repo intro, retrieved files, relevant symbols. Click the badge to expand the context that was sent. Disable the enhancer in Settings → Chat → Prompt enhancer if you'd rather it stay out of the way.
How it picks symbols and files:
- Identifier extraction — file paths, PascalCase / camelCase / snake_case names, and backticked bare identifiers in your draft. Stoplisted against common English and language keywords. Capped at 8.
- Single ripgrep call — all symbols OR'd together, word-regex + ignore-case, build dirs globbed out, 1.5 s hard timeout. Returns up to 10 relative file paths.
- Repo intro — package.json name and headline, README first line, top-level files. Detects Next.js, React, Electron, Vite, Prisma, Anthropic SDK, etc. Cached per cwd for 5 minutes.
If any step fails (no ripgrep, no package.json, timeout), the enhancer still returns — it just enhances with whatever it found.
Auto-compact on context-exceeded
Pi-routed sessions (OpenAI, Codex, Gemini, OpenAI-compat) don't get the Claude Agent SDK's automatic compaction at ~77.5% of the model's context window — they tend to silently fail with a 400 once the conversation grows past the limit. Fabric Agents recognises the failure and recovers without your input:
- The error handler detects context-exceeded 400s by phrase ("context length", "context window", "too many tokens", "input is too long", "reduce the length", and so on across providers).
- It marks the failure, removes the failed user message from history, runs
/compact, and resends the original message + attachments + options. - A user-visible info shows briefly — "Context window exceeded — compacting and retrying…" — so the pause reads as a deliberate recovery rather than a hang.
- If the retry also fails, a friendlier "Context Window Exceeded" error surfaces with suggestions (use a higher-context model, branch the session, etc.).
Anthropic-direct sessions don't need this — the SDK already handles compaction at the threshold. The retry loop has a single-attempt guard so a model that consistently exceeds context can't loop forever.
Auto-archive idle sessions (opt-in)
Set in Settings → App → Session retention. Sessions whose lastMessageAt is older than the threshold are archived automatically:
| Setting | Behaviour |
|---|---|
Off (default) | Manual archive only. Upgrading users see no surprise behaviour. |
30 days / 90 days / 365 days | Idle sessions older than the threshold are archived on app launch. |
The sweep runs once per launch, non-blocking, after the initial session load. It skips:
- Flagged (pinned) sessions — exempt from automation.
- Sessions currently processing — never archive mid-turn.
- Hidden sessions (mini-edit scratch) — cleaned up another way.
- Already-archived sessions.
- Sessions with a recent
lastMessageAt.
Archives are capped at 500 per launch so a first-time enable on a workspace with thousands of old sessions doesn't turn into a multi-minute foreground I/O burst — subsequent launches continue the sweep, eventually consistent.
Manual archive from the session menu always works regardless of the policy.
Auto-transition session status
Status is the inbox vs archive divider, plus a workflow indicator. Fabric Agents updates it as the session moves:
| Trigger | Transition |
|---|---|
| New session | Lands in todo. |
| You send a message | todo → in-progress. |
| Agent completes a turn | in-progress → needs-review. |
| You manually set a status | Auto-transitions stop respecting it on this session. |
Session reaches done or cancelled | Closed; doesn't re-open on activity. |
The default workspace ships with todo, in-progress, needs-review, done, cancelled. Existing workspaces from before this change are migrated v1 → v2 — backlog is folded into todo, in-progress is added.
You can edit this transition logic in Settings → Workspace → Statuses by changing which status is the default open state. See Statuses for the config schema.
Disabling auto behaviours
| Behaviour | Where to turn off |
|---|---|
| Prompt enhancer | Settings → Chat → Prompt enhancer (per-app) |
| Auto-compact | Always on for Pi-routed sessions; cannot be disabled (it's a recovery, not a policy) |
| Auto-archive | Settings → App → Session retention → Off (default) |
| Auto-transition | Custom statuses without auto-transition rules; manual status changes pin a session |
Related
- Conversations — what a session is
- Statuses — full status configuration schema
- Permissions — Explore vs Ask vs Execute mode
Working Directory
How Fabric Agents' working directory model works — per-session `workingDirectory`, the immutable `sdkCwd`, and agent isolation worktrees for child sessions.
LLM Providers
Fabric Agents works with every frontier model — Anthropic, OpenAI, Google, Moonshot Kimi, and any OpenAI-compatible endpoint. This page covers setup for each.