Repository navigation
Conversation
The receipt-driven Tokenless uninstaller now keeps its recorded shell PATH entry when npm removal is interrupted and the recorded CLI is still a regular executable. A fresh shell can continue using the kept command until a successful uninstall retry removes the installation. Check the existing npm retention flags and receipt file list without executing the payload. Keep clearing stale PATH entries after partial CLI removal or adapter-only failures. Add isolated public-script tests to the local install gate and existing adapter CI runner. User-visible changes: - `bash src/tokenless/scripts/uninstall.sh`: Preserve the recorded PATH entry after an incomplete npm uninstall that retains the recorded executable Tokenless CLI. Successful retry still removes the entry. Arguments and exit codes are unchanged. Fixes: 0a6fc32 ("feat(tokenless): add npm, curl, and skill routes") Assisted-by: Codex Signed-off-by: coder999o <soft_99@126.com>
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.
Why
At official main
9a99f8782e56930db2345deef25299c49939d0ab, the receipt-driven Tokenless uninstaller removes the recorded shell PATH block even when npm is missing, refuses removal, or cannot run because a prefix launcher was taken over. The script retains the working CLI and receipt and returns 1, but a fresh shell can no longer findtokenless.What changed
make test-install-scriptand the existingmake test-adaptersparallel runner used by CI.Related issue
Closes #10938.
User / Agent impact
bash src/tokenless/scripts/uninstall.shpreserves shell access to the retained CLI after an incomplete npm removal. A successful retry removes the package, launchers, receipt and installer-owned PATH block while preserving unrelated shell settings and runtime data.This corrects the existing recovery behavior. Command syntax, receipt schema, ownership decisions and incomplete-uninstall exit codes remain unchanged. The change does not recreate a PATH block removed by a previous uninstall attempt.
Risk and compatibility
The behavior change is limited to PATH retention for the existing npm interruption states. Receipt membership and regular-file/executable checks prevent retaining a stale entry solely because uninstall is incomplete. No dependency, privilege, workflow or receipt-format changes are introduced. Dry-run and purge previews remain read-only.
Validation
Tested revision:
4507595231bbe49c7c35c552aa727f16bbdffc2f(the committed files match the tested file hashes). Independent read-only review found no actionable defects.Local environment: macOS arm64, Bash 3.2.57 and Python 3.13.0. Fixtures use a temporary HOME, valid schema-3 receipts and isolated npm stubs; no real installation or host npm was changed.
tests/run-parallel.pyboth propagate that failure.python3 -B src/tokenless/tests/test_uninstall_path.py: passes all 5 test methods / 25 parameterized scenarios, including fresh-shell lookup, successful retries, retained runtime data, no CLI invocation during uninstall, missing/non-executable/unrecorded/directory CLI, partial npm removal, adapter failure, terminal ownership policies, and unchanged dry-run snapshots.python3 tests/run-parallel.py -- 'python3 tests/test_uninstall_path.py'fromsrc/tokenless: passes on the candidate.bash -n src/tokenless/scripts/uninstall.sh, Black 26.3.1 (--check --line-length 88 --target-version py311),git diff --check, andmake -C src/tokenless test-install-docs: pass.make -C src/tokenless test-install-script: the new suite passes, then the unchanged shell harness fails its first source-build assertion (expected '0', got '1'). Running the original shell harness before the fix produces the same failure on this macOS host.make -C src/tokenless test-adapters: stops before the parallel runner in the unchangedtest-package-npm-prebuilt.sh:187, whosestat -cinvocation is incompatible with BSD stat on this host.Full local acceptance is therefore incomplete. Python 3.11 runtime, Linux execution and GitHub CI results have not been verified locally; the suite is wired into the existing Python 3.11 CI job without changing its workflow.
Documentation and rollback
No command or configuration reference changes are needed for this correction to the existing recovery behavior. Reverting this commit restores the previous cleanup policy; no stored-data migration is required.