Skip to content
Open
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
32 changes: 32 additions & 0 deletions config/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# NeuriCo Interactive Manager Configuration
#
# These settings control the behavior of the interactive mode manager.
# Override via environment variables (NEURICO_MANAGER_*) or .env file.

manager:
# LLM backend for manager reasoning
# Options: "cli" (uses claude -p, no extra keys), "anthropic_api", "openrouter"
# Can also be set via NEURICO_MANAGER_BACKEND env var
llm_backend: cli

# Model to use for manager reasoning (null = default for backend)
# For cli: uses whatever claude version is installed
# For anthropic_api: e.g., "claude-sonnet-4-20250514"
# For openrouter: e.g., "anthropic/claude-sonnet-4"
# Can also be set via NEURICO_MANAGER_MODEL env var
llm_model: null

# Engagement level: how often the manager stops to ask the user
# "hands_off": only critical decisions (direction changes, failures)
# "balanced": stage transitions + significant choices (default)
# "hands_on": frequent check-ins, present options at every step
engagement: balanced

# How often to check agent status during long runs (seconds)
poll_interval: 60

# How often to proactively show progress summaries during long runs (seconds)
engagement_interval: 1800 # 30 minutes

# Default AI provider for research agents
default_provider: claude
79 changes: 79 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,77 @@ cmd_config() {
# -----------------------------------------------------------------------------
# Show help
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Interactive mode: run a single agent inside Docker (internal command)
# Used by the interactive manager to invoke individual agents
# -----------------------------------------------------------------------------
cmd__run_agent() {
if [ -z "$1" ]; then
echo -e "${RED}Usage: $0 _run-agent <agent_name> --workspace <path> --provider <provider> --run-id <id> --idea-file <path>${NC}"
echo "Agents: resource_finder, experiment_runner, paper_writer, comment_handler"
exit 1
fi

ensure_directories
check_env_file

local gpu_flags=$(get_gpu_flags)
local user_flags=$(get_user_flags)
local credential_mounts=$(get_cli_credential_mounts)
local workspace_dir=$(get_workspace_dir)

echo -e "${BLUE}Running agent: $1${NC}"
echo -e "${BLUE}Workspace:${NC} $workspace_dir -> /workspaces"

eval "docker run --rm \
$gpu_flags \
$user_flags \
--env-file \"$PROJECT_ROOT/.env\" \
-e NEURICO_WORKSPACE=/workspaces \
-v \"$workspace_dir:/workspaces\" \
-v \"$PROJECT_ROOT/ideas:/app/ideas\" \
-v \"$PROJECT_ROOT/logs:/app/logs\" \
-v \"$PROJECT_ROOT/config:/app/config:ro\" \
-v \"$PROJECT_ROOT/templates:/app/templates:ro\" \
$credential_mounts \
-w /app \
\"$IMAGE_NAME\" \
python /app/src/core/agent_runner.py $@"
}

# -----------------------------------------------------------------------------
# Interactive mode: launch the manager on the host
# The manager runs outside Docker and uses _run-agent to invoke agents
# -----------------------------------------------------------------------------
cmd_interactive() {
if [ -z "$1" ]; then
echo -e "${RED}Usage: $0 interactive <idea_id> [--provider claude] [--engagement balanced]${NC}"
exit 1
fi

# The manager runs on the HOST, not inside Docker
# It needs Python available on the host
if ! command -v python3 &> /dev/null && ! command -v python &> /dev/null; then
echo -e "${RED}Python 3 is required on the host for interactive mode.${NC}"
echo "Install Python 3.10+ and try again."
exit 1
fi

local python_cmd="python3"
if ! command -v python3 &> /dev/null; then
python_cmd="python"
fi

echo -e "${BLUE}Starting NeuriCo Interactive Mode...${NC}"
echo ""

# Pass all arguments to the manager
# The manager will handle idea loading, Docker invocations, and user interaction
NEURICO_PROJECT_ROOT="$PROJECT_ROOT" \
NEURICO_WORKSPACE_DIR="$(get_workspace_dir)" \
$python_cmd "$PROJECT_ROOT/src/interactive/manager.py" "$@"
}

cmd_help() {
show_banner
show_status
Expand All @@ -1669,6 +1740,7 @@ cmd_help() {
echo " fetch <url> [--submit] Fetch idea from IdeaHub"
echo " submit <idea.yaml> Submit a research idea"
echo " run <id> [options] Run research exploration"
echo " interactive <id> Interactive mode with human-in-the-loop"
echo " update-tools Update Claude/Codex/Gemini to latest versions"
echo " bump-version <version> Bump version across all files (e.g., 0.3.0)"
echo " up Start container in background (compose)"
Expand All @@ -1683,6 +1755,7 @@ cmd_help() {
echo "Daily usage:"
echo " $0 fetch https://ideahub.example.com/idea/123 --submit --run --provider claude --full-permissions"
echo " $0 run my-idea-id --provider claude --full-permissions"
echo " $0 interactive my-idea-id --provider claude"
echo " $0 shell"
echo ""
}
Expand Down Expand Up @@ -1728,6 +1801,12 @@ case "$ACTION" in
run)
cmd_run "$@"
;;
_run-agent)
cmd__run_agent "$@"
;;
interactive)
cmd_interactive "$@"
;;
update-tools)
cmd_update_tools
;;
Expand Down
Loading