Skip to content

update: a desktop app's engine is told to update the app, not to rebuild - #2840

Merged
AbirAbbas merged 2 commits into
app/v3from
fix/update-app-bundle-before-source-build
Nov 19, 2026
Merged

AbirAbbas merged 2 commits into
app/v3from
fix/update-app-bundle-before-source-build

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

#2820 made codeaf update refuse a codeaf inside a macOS application bundle with a message naming the app. The engine the desktop app carries is built from a bare commit (make app-sidecar), so its revision kind is other. Both codeaf update (cmd/codeaf/update.go) and the chat's /update (internal/tui3/updatecmd.go) answer a source build before they reach any refusal, so the shipped app never gets the #2820 refusal.

The bundled engine from the published workaf-dev macOS arm64 DMG (0.1.0-dev.20261119.34, engine 2097ee7) printed, with exit status 2:

this codeaf was built from source (2097ee7) at …/WorkAF.app/Contents/MacOS/codeaf — rebuild with make build, or install a release: curl -fsSL https://agentfield.ai/get/codeaf | bash

Nothing was replaced, but the advice is wrong for the app's engine. The manual already said "codeaf update says so", which wasn't true for this build.

The change

  • update.BundleRefusal(target, curl) returns InstallRefusal's answer for a target inside an application bundle, and "" for any other target. InstallRefusal now uses it, so the wording stays in one place.
  • codeaf update asks it before the source-build answer. The chat's /update asks the new UpdateCoordinator.BundleRefusal hook, which chatv3_surface.go wires to the same function. Every other refusal still runs inside the installer, as before.
  • The manual sentence now covers /update and says the app's engine is a source build.

Only the bundle refusal moves ahead of the source-build answer. A source build that is package-managed or in an unwritable folder still gets the source-build note, as before.

Tests

  • TestSourceBuildInsideAnAppBundleIsLeftToItsApp (cmd/codeaf): a source revision at …/WorkAF.app/Contents/MacOS/codeaf exits 2 with "this codeaf is part of WorkAF.app … update the app", never "built from source", and never touches the network. Before the fix it failed with the message quoted above.
  • TestSourceBuildInsideAnAppBundleUpdateNamesTheApp (internal/tui3): /update gives the app's refusal and resolves or installs nothing.
  • TestBundleRefusalIsInstallRefusalsAnswerForABundleOnly (internal/update).
  • Real entry point: a binary built from this branch at WorkAF.app/Contents/MacOS/codeaf prints this codeaf is part of WorkAF.app · that app updates it, so update the app, or install a separate codeaf with: curl -fsSL https://agentfield.ai/get/codeaf | bash and exits 2.
  • make test-packed-manual manual-gates and the focused update tests in the three packages pass.
  • make test-quick passes except TestATrackedConversationIsReachedAndAForgottenOneIsNot (cmd/codeaf), which failed once with TempDir RemoveAll cleanup: … Library/Application Support/dev.furrow.furrow/store-v1: directory not empty. That failure is pre-existing and unrelated: it failed 1 of 20 runs on unpatched origin/app/v3 and 0 of 20 on this branch.
  • make pr-ready BASE=origin/app/v3 had one failure of the same kind in cmd/codeaf: TestTheSameSentenceIsInTheJSONAnswer hit TempDir RemoveAll cleanup: … directory not empty. Run alone it passed 10 of 10 on this branch and 10 of 10 on the base. Both look like a background writer racing t.TempDir cleanup under load, which this change doesn't touch. Every other package passed.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits November 19, 2026 09:03
The engine a desktop app carries is built from a bare commit, so `codeaf
update` and the chat's /update answered it with the source-build note ("rebuild
with make build, or install a release") before the app-bundle refusal from
#2820 could be asked. That refusal was unreachable from the shipped app.

BundleRefusal is InstallRefusal's answer for a target inside a macOS
application bundle, with the wording kept in one place. Both update surfaces ask
it before turning a source build away; every other refusal still lives inside
the installer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AbirAbbas
AbirAbbas merged commit 1fe61a3 into app/v3 Nov 19, 2026
14 of 17 checks passed
@AbirAbbas
AbirAbbas deleted the fix/update-app-bundle-before-source-build branch November 19, 2026 14:31
AbirAbbas added a commit that referenced this pull request Nov 23, 2026
… (#2883)

app/v3 was landed on dev on 2026-11-11. Five pull requests merged into app/v3 afterwards are now on dev, one commit each in this change:

- connect: GitHub is a connector, and it is the Factory's GitHub (app/v3 #2645)
- fix(app): connect independent custom providers and revalidate saves (app/v3 #2649)
- app: --home is a home the person keeps: other tools' skills, program copies, fence (app/v3 #2819)
- update: an engine inside a macOS app bundle is left to its app (app/v3 #2820)
- update: a desktop app's engine is told to update the app, not to rebuild (app/v3 #2840)

Co-authored-by: Santosh <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant