Repository navigation
Build-then-review pipelines, completion time, watched-run usage, queue refresh, control sockets - #2609
Merged
Conversation
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…r process (#2603) The test binary made a fresh /tmp/rtNNNN runner base in every process. Helper children re-run the binary with an environment of their own, and some are killed or leave through os.Exit, so they never removed theirs: one empty directory piled up per helper on every run, on macOS and Linux alike. The base is now one fixed folder per user, /tmp/codeaf-test-<uid>, shared by every test process and never removed. It is still short enough for macOS's socket path limit and still never the live /tmp/codeaf-runners-<uid>. Socket names inside are hashes of each test's own state root, so concurrent runs do not meet. Windows keeps a per-process folder. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
marked this pull request as ready for review
November 13, 2026 00:13
This was referenced Nov 13, 2026
santoshkumarradha
added a commit
that referenced
this pull request
Nov 16, 2026
…operator plumbing Both pins reached the tree without a registry line (#2638, #2609), which left TestRegistryCoversEveryUserFacingEnvironmentPin red on santosh/work. Each is a path an operator sets for one server or one launch, never a row a project file could write. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha
added a commit
that referenced
this pull request
Nov 17, 2026
…operator plumbing Both pins reached the tree without a registry line (#2638, #2609), which left TestRegistryCoversEveryUserFacingEnvironmentPin red on santosh/work. Each is a path an operator sets for one server or one launch, never a row a project file could write. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha
added a commit
that referenced
this pull request
Nov 17, 2026
…operator plumbing Both pins reached the tree without a registry line (#2638, #2609), which left TestRegistryCoversEveryUserFacingEnvironmentPin red on santosh/work. Each is a path an operator sets for one server or one launch, never a row a project file could write. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
AbirAbbas
added a commit
that referenced
this pull request
Nov 27, 2026
…ld run starts (hotfix of #2478's live flags) The AgentField Go SDK starts a watched run as `codeaf chat --once TEXT --json --yolo --no-host --model M --max-hours H --events E --steer S --session P`. v0.8.2 and v0.8.3 refused `--json` ("codeaf chat has no --json flag") and exited at once, so every watched run failed before it began and WorkAF showed no live transcript. This carries the three live flags from dev (#2478, with #2609's per-run accounting in the envelope) onto the v0.8.3 line, without the factory engine around them: dev relays a question the model asks to the watcher over --events, and that needs internal/factory, which this line does not have. A question here takes its own default, as any headless run does. It also fixes a defect dev has too (#2999): Agent.Steer returns a live view of the turn it steers, which the run is already printing, so a steered run printed its answer twice. The steer's stream now passes nothing on until the steer falls through. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2599. Fixes #2600. Fixes #2601. Fixes #2602. Fixes #2603.
Five defects found while running the whole factory loop (control plane → factory →
swe-planner.build_issue→ pull request →pr-af.review) with the desktop watching.{pr_url}is a job fact, filled from the job's existing first-opened-PR record, and only where a step's input maps it. A step that asks for it before a pull request exists stops with a sentence saying so and dispatches nothing. Pipelines that do not use it are unchanged.chat --once --jsonnow carriestokens: {in, out}andspend_usd, the same field definitionexec --jsonemits, so the AgentField SDK (which already reads those names) records usage for watched runs. Additive: older readers ignore them.factory.jobs_changedis sent when a background step reaches its person gate and when a job completes, not only when one is filed.CODEAF_FACTORY_RUNTIME_DIR(an absolute directory; every process that shares the factory must set the same one). Unset, the socket stays where it was, which is deliberately independent ofTMPDIRso processes started with different temporary directories still find each other. A directory whose socket path would exceed the platform's limit falls back to the default and says why.The manual says each of these.
Live check (Linux, one machine, real control plane, SWE-AF planner, pr-af and models)
build_issuethenpr-af.reviewwithpr_url: "{pr_url}"was saved throughfactory.library_setand run unsteered on a new issue. The build opened its pull request; the review was dispatched after it with the real pull request URL and ran a real review; the job ended complete with a completion time.finished and opened <pull request>for the build andfinishedfor the review. (The first live run showed the review line claiming the pull request; that is the last commit's fix.)factory.jobs_changedarrived at both approval gates and at completion.CODEAF_FACTORY_RUNTIME_DIRset, the runner's control socket was created there (directory 0700, socket 0600) and nothing new appeared in the default location.Checked on macOS
macOS 15.6 (arm64), default
TMPDIR:make build,make test-quick, the factory, appwire and knowledge packages, the factory/AgentField/envelope/runner tests ofcmd/codeaf, and the keyless automations end-to-end on the real binary. The three control-socket tests pass 10 of 10 under macOS's long temporary path; tests now use one fixed per-user folder (/tmp/codeaf-test-<uid>) and never create, change or remove anything in the live runner folder (watched during the run). Sixcmd/codeaffactory tests fail on macOS ondevtoo (a test helper narrowsPATHto/usr/bin, which on macOS has nobash); they are not from this change.Checked
-race.make test-quick.internal/factory/...,internal/appwire/...and the factory, AgentField, envelope and runner tests ofcmd/codeaf, once. Reds there were compared withdev: one expects a refused loopback connection, five needbashon a fixture's PATH and fail ondevthe same way, four are timing checks that pass alone on both trees.Mac check list
Pending human verification on a Mac. From this checkout, prepare a short scratch directory and use the repository's Go toolchain:
mkdir -p /tmp/af-check export TMPDIR=/tmp/af-check GOFLAGS=-p=3 CODEAF_TELEMETRY=off go build ./... go vet ./...go test ./internal/factory/serve -run '^TestWorkerAgentFieldPipelineCompletionHasDoneAt$' -count=1 -v -timeout 2m. Both remote-end and missing-end cases pass: job, queue and reloaded store retain nonzero done_at for the approved answer pipeline, with no PR.go test ./cmd/codeaf -run '^TestFactoryJobsChangedRefreshesPersonGatesAndCompletion$' -count=1 -v -timeout 2m. The synthetic trigger entry's person gate appears in the Needs you queue on a jobs_changed event, completion also refreshes, and an unchanged write adds no notification.go test ./cmd/codeaf -run '^TestChatOnceEnvelopeAccountsForOnlyThisInvocation$' -count=1 -v -timeout 2m. Success, resumed invocation and paid-work failure pass against a scripted provider; totals are 100 input tokens, 20 output tokens and $0.125 per observed paid call. The second invocation excludes earlier totals, and a failure keeps spending. No real model key is needed. After the sibling SDK fix, repeat the watched CP integration and check exactly one harness-usage record against these stdout fields; that cross-repository acceptance remains a separate integration check.go test ./cmd/codeaf -run '^TestFactoryRunnerRuntime|^TestAppSharesSessionsWithElectedTerminalRunnerWithoutDiskSecrets$' -count=1 -v -timeout 2m. Startup uses the isolated socket, its directory/socket are 0700/0600, another process object shares sessions, different profiles do not collide, oversized paths explain their fallback, a long TMPDIR preserves default sharing, and a directory symlink is refused. For isolated launches setCODEAF_FACTORY_RUNTIME_DIRto the same absolute short base in every participant, e.g. the launch's TMPDIR.go test ./cmd/codeaf ./internal/factory -run '^TestFactoryAgentFieldPipelineHandsPullRequestToReview$|^TestAgentFieldReviewRefusesUnavailablePullRequestBinding$|^TestAgentFieldPullRequestBindingKeepsDefaultInputs$' -count=1 -v -timeout 2m. The library save and leased worker pass a scripted build PR to review in order; no-PR and premature consumers stop before dispatch; default inputs stay unchanged. No GitHub write or model key is needed.🤖 Generated with Claude Code