Repository navigation
chore: read the app version from package.json only - #2217
Draft
Douglasymlai wants to merge 1 commit into
Draft
Douglasymlai wants to merge 1 commit into
Douglasymlai wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Problem
Every release had to write the new version number in five places:
package.json, the Brain's terminal toolkit, the bug-report issue template, a comment inbuild.yml, and the updater unit test. Missing one of them breaks things quietly. For example, if the Brain's copy is stale, it looks for the terminal environment under the wrong~/.eigent/venvs/terminal_base-<version>folder. Agents then lose the preinstalled terminal packages and fall back to a slower copy of the Brain's own environment.Cause
The Brain hardcoded
APP_VERSION, and the test, template and comment each held a literal copy of the current release number.Fix
app.getVersion()(thepackage.jsonversion) asEIGENT_APP_VERSION. Electron already uses this same value to name the terminal venv, so both sides always agree.app/utils/app_version.py, in this order: theEIGENT_APP_VERSIONenv var, then the repository'spackage.json(for a Brain started from a source checkout without Electron), thenunknown. A value is only used if it looks like a plain version string, because it becomes part of a folder name.build.ymlcomment no longer name a specific version.After this change, a release only needs to edit
package.json.Testing
pytest tests/app/utils/test_app_version.py tests/app/agent/toolkit/test_terminal_toolkit.py tests/app/agent/toolkit/test_terminal_preflight_integration.py: 46 passed. The new tests check that the env var wins, thepackage.jsonfallback works, unsafe values are rejected, and in a source checkout the result matches the rootpackage.json.npx vitest run test/unit/electron/githubReleaseCdnProvider.test.ts test/unit/electron/main/brainAppVersionEnv.test.ts test/unit/electron/main/bundledGitPackaging.test.ts: 9 passed.npm run type-check,eslint,prettier --check,ruff check/ruff format --check,git diff --check: clean.~/.eigent/venvs/terminal_base-<package.json version>is the folder that gets cloned.