Skip to content

Build-then-review pipelines, completion time, watched-run usage, queue refresh, control sockets - #2609

Merged
AbirAbbas merged 10 commits into
devfrom
fix/e2e-findings-2026-11-12
Nov 13, 2026
Merged

AbirAbbas merged 10 commits into
devfrom
fix/e2e-findings-2026-11-12

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

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.

The manual says each of these.

Live check (Linux, one machine, real control plane, SWE-AF planner, pr-af and models)

  • A pipeline of build_issue then pr-af.review with pr_url: "{pr_url}" was saved through factory.library_set and 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.
  • The steps read finished and opened <pull request> for the build and finished for the review. (The first live run showed the review line claiming the pull request; that is the last commit's fix.)
  • The watched build recorded 12 usage rows on the control plane (none before this change).
  • factory.jobs_changed arrived at both approval gates and at completion.
  • With CODEAF_FACTORY_RUNTIME_DIR set, 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 of cmd/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). Six cmd/codeaf factory tests fail on macOS on dev too (a test helper narrows PATH to /usr/bin, which on macOS has no bash); they are not from this change.

Checked

  • Nine new tests on scripted queue and control-plane fixtures, each failing on the unchanged tree for the right reason; 10 runs each and 3 with -race.
  • Build and vet for Linux, Windows and macOS; make test-quick.
  • internal/factory/..., internal/appwire/... and the factory, AgentField, envelope and runner tests of cmd/codeaf, once. Reds there were compared with dev: one expects a refused loopback connection, five need bash on a fixture's PATH and fail on dev the 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 ./...
  • Completed AgentField pipeline jobs reach the queue without a completion timestamp #2600: 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.
  • Needs you does not refresh when a newly filed pipeline reaches its person gate #2602: 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.
  • Watched chat JSON omits the token and spend summary needed for remote accounting #2601: 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.
  • Factory control sockets are created outside a configured temporary directory #2603: 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 set CODEAF_FACTORY_RUNTIME_DIR to the same absolute short base in every participant, e.g. the launch's TMPDIR.
  • A build-and-review pipeline cannot pass the opened pull request to pr-af.review #2599: 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

AbirAbbas and others added 10 commits November 12, 2026 06:42
…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 AbirAbbas changed the title HOLD: build-then-review pipelines, completion time, watched-run usage, queue refresh, control sockets Build-then-review pipelines, completion time, watched-run usage, queue refresh, control sockets Nov 13, 2026
@AbirAbbas
AbirAbbas marked this pull request as ready for review November 13, 2026 00:13
@AbirAbbas
AbirAbbas merged commit 662cdd6 into dev Nov 13, 2026
8 checks passed
@AbirAbbas
AbirAbbas deleted the fix/e2e-findings-2026-11-12 branch November 13, 2026 00:14
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment