Files
archie/.okf/codebase/internal/container/pool_test.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.3 KiB

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

Module pool_test.go

Path: internal/container/pool_test.go
Lines: 115

Snippet Preview

package container

import (
	"encoding/json"
	"os"
	"path/filepath"
	"testing"
	"time"
)

// ── regression: Gap 2 — post-completion grace period ────────────────

func TestContainerSupportsGracePeriod(t *testing.T) {
	// Gap 2: MaxUptime is a container-level context timeout at creation,
	// not a post-completion grace period. PRD section 1 says:
	// "max_uptime — grace period after task completion before kill."
	//
	// The agent should stay alive after the task finishes so it can
	// handle follow-ups (gate re-runs, human replies). Currently
	// Release() stops the container immediately — there's no way to
	// keep it alive after task completion.

	c := &Container{ID: "test"}
	grace := 5 * time.Minute

	// A container must support being kept alive after task completion.
	// This means: after Release() is called (task done), the container
	// stays up for the grace period to handle follow-ups. Only after
	// the grace period expires (or on explicit shutdown) is it killed.
	//