Files
archie/.okf/codebase/internal/agentexec/subprocess.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

1.1 KiB

description, resource, tags, timestamp, title, type
description resource tags timestamp title type
Source module internal/agentexec/subprocess.go (162 lines). internal/agentexec/subprocess.go
go
source
2026-07-21T18:36:22Z subprocess.go Module

Module subprocess.go

Path: internal/agentexec/subprocess.go
Lines: 162

Snippet Preview

package agentexec

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"os/exec"
	"strings"
)

const maxDiagnosticBytes = 64 << 10

// SubprocessRunner executes each agent stage in a fresh archie-agent process.
type SubprocessRunner struct {
	Command string
	Args    []string
	// Environ is the daemon environment to select from. AdditionalEnv names
	// operator-approved compatibility variables; the requested provider's key
	// variable is added automatically for that invocation only.
	Environ       []string
	AdditionalEnv []string
	Diagnostics   io.Writer
	Providers     map[string]Provider
}

func (r *SubprocessRunner) Run(ctx context.Context, workspace string, req Request) (Result, error) {
	providerName, _, ok := strings.Cut(req.Model, "/")