Skip to content

Various fixes: auth stability, CLI reliability, and docs alignment#1121

Merged
sqrrrl merged 8 commits intogoogle:masterfrom
TheCrazyLex:dev/various-fixes-cli-docs
Feb 13, 2026
Merged

Various fixes: auth stability, CLI reliability, and docs alignment#1121
sqrrrl merged 8 commits intogoogle:masterfrom
TheCrazyLex:dev/various-fixes-cli-docs

Conversation

@TheCrazyLex
Copy link
Contributor

Summary

This PR bundles several fixes across auth stability, command reliability, MCP messaging clarity, interactive output formatting, CLI documentation accuracy, and formatting hygiene.

Changes

  • Fixed logout behavior to await credential store deletion before reporting success, so deletion failures are surfaced correctly.
  • Fixed OAuth token refresh persistence to store tokens.id_token in the id_token field (instead of tokens.access_token) in both:
    • loaded credential refresh path
    • post-login credential refresh path
  • Added regression coverage for:
    • logout failure handling with an unwritable auth file
    • id_token persistence across both refresh paths
  • Awaited project settings writes in create/clone flows so command success is not reported before .clasp.json persistence completes.
  • Added controlled user-facing errors for invalid explicit --project and --ignore paths, replacing raw filesystem errors.
  • Aligned MCP response text with actual operations for push/pull/clone/create flows.
  • Fixed an extra } in the interactive open-web-app deployment choice label formatting.
  • Updated the README command index to remove stale tail-logs flags and match currently supported options.
  • Applied biome formatting cleanup in src/core/files.ts to eliminate a pre-existing npm run check failure.

Validation

  • Ran: npm run check
  • Ran: npx mocha test/commands/logout.ts test/auth/auth.ts --reporter dot
  • Ran: npx mocha test/commands/open-webapp.ts --reporter dot
  • Ran: npx mocha test/core/clasp.ts test/commands/create-script.ts test/commands/clone-script.ts --reporter dot
  • Result: all passing

Ensure project settings persistence is awaited before command and MCP clone flows return success.
This removes fire-and-forget writes so I/O failures are surfaced in-band instead of being lost.
Add assertions that create/clone produce a persisted .clasp.json and add a real filesystem test that setProjectId propagates write failures.
Convert explicit missing config and ignore paths into controlled CLI errors instead of bubbling raw fs.stat ENOENT output.
Treat both ENOENT and ENOTDIR as user path-not-found cases so directory/file mixups are handled consistently.
Cover both error paths with real filesystem tests and validate the exact CLI messages via direct command execution.
Update MCP pull_project and clone_project status text to match the actual operation names.
Correct create_project and clone_project error text that previously referenced push.
Keep this scoped to user-facing response copy without changing command behavior.
Correct the deployment choice label in open-web-app by removing an
extra closing brace from the rendered string.

This prevents malformed output in the interactive deployment picker.
Remove stale --open and --setup flags from the tail-logs command
summary so it matches the current CLI implementation.

This keeps the command index aligned with supported options.
Apply biome formatting adjustments in Files core implementation to eliminate the pre-existing check failure.
This is a non-functional change that only normalizes whitespace, indentation, and line wrapping.
Keeps the combined PR green under npm run check.
Await credential store deletion in the logout command so write failures
are surfaced before success output is emitted.

Add a regression test with an unwritable auth file to verify logout exits
with an error and does not print JSON success when deletion fails.
Stop writing access tokens into the id_token field when OAuth tokens
refresh for loaded credentials and post-login credentials.

Add auth-level regression tests that trigger refresh events through both
code paths and verify the persisted id_token value matches token.id_token.
Include import ordering updates in the new auth test to satisfy lint checks.
@TheCrazyLex
Copy link
Contributor Author

@sqrrrl Thank you for your previous quick reviews! Please see this and the other new PRs too when you can :)

I combined the smaller fixes in this one - would be really cool if these could be reviewed and shipped in a new release soon - I stand ready to discuss and adjust as needed.

@sqrrrl sqrrrl merged commit b0fa745 into google:master Feb 13, 2026
3 checks passed
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.

2 participants