forked from smallcloudai/refact
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Exec Runtime
refact-planner edited this page Jun 7, 2026
·
1 revision
The shared runtime that executes foreground commands, background processes, services, and PTY sessions.
See also Processes and PTY.
The exec runtime is unified across shell, process_start, and the related process tools. It applies standardized environment defaults before request-specific environment overrides.
Model-facing prompt: run a command.
Schema highlights:
-
command: stringrequired -
description: stringrequired - optional
workdir - optional
timeout - optional output filters
- optional
tty: boolean = false - optional
run_in_background: boolean = false
Notes:
-
descriptionmust be non-empty. - numeric
timeoutmust be a positive integer. -
run_in_backgroundskips the foreground timeout path and returns a process id. - Do not append
&when usingrun_in_background.
Examples:
{"command":"npm test","description":"Run frontend tests"}
{"command":"python3 -i","description":"Start Python REPL","tty":true,"run_in_background":true}The unified runtime owns:
- foreground commands
- background processes
- services
- PTY sessions
For terminal behavior:
-
tty: falseuses stdout/stderr pipes. -
tty: trueuses the PTY path and combines stdout/stderr intocombined. - PTY output is transcripted through the same bounded runtime buffers as pipe output.
- PTY can change command behavior and should not be enabled for plain builds/tests unless needed.
All foreground, background, service, and PTY spawns apply EXEC_ENV_DEFAULTS before request env overrides. Request-provided env values win.
| Key | Value | Why |
|---|---|---|
NO_COLOR |
1 |
Keep transcripts stable and readable without ANSI color noise. |
TERM |
dumb |
Discourage interactive/full-screen terminal behavior unless tty=true. |
LANG |
C.UTF-8 |
Provide deterministic UTF-8 locale. |
LC_CTYPE |
C.UTF-8 |
Preserve UTF-8 character classification. |
LC_ALL |
C.UTF-8 |
Avoid locale-specific output drift. |
COLORTERM |
empty | Disable color auto-detection. |
PAGER |
cat |
Prevent commands from blocking in pagers. |
GIT_PAGER |
cat |
Prevent git from blocking in pagers. |
GH_PAGER |
cat |
Prevent GitHub CLI from blocking in pagers. |
REFACT_EXEC |
1 |
Marker that a process is running under Refact exec. |
The process-facing tools and their cursor/notification model are documented in Processes and PTY.
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice