v0: colab_drive_auth - automated Drive mount handoff (URL -> consent -> Enter) #3
Labels
No labels
area/backup
area/cli
area/docs
area/dsh
area/forgejo
area/host
area/mcp
area/plugin
area/security
area/ux
needs-operator
priority/later
priority/next
priority/now
type/bug
type/research
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-colab#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Automate the one manual step in the workflow: the Drive OAuth + Enter handoff.
Current manual flow
colab drivemount -s <name>triggersdrive_auth_needed; a browser consent page opens (or a URL is logged); the operator clicks the account, grants Drive, closes the tab, and presses Enter in the terminal. Only then does the CLI finish mounting.Proposed tool:
colab_drive_auth(session, project, timeout_s=180)/content/drive/MyDrive/<project>already lists → returnmounted(idempotent).colab drivemount -s <session>under a PTY so prompts are observable and writable.colab logshowsdrive_auth_needed; the CLI prints the verification URL in the automation output).xdg-openon t14 and return it to the DSH caller so the Web GUI can show a clickable link (operator may be on another machine).colab ls -s <session> /content/drive(mount appears once authorized); also watch PTY for an "Enter" prompt.\nto the PTY, wait for exit/automation_result, verify the project dir, returnmounted+ path.auth_pendingwith the URL so the caller can retry or hand off.Security
Open questions
drivemountandexec-drivengoogle.colab.drive.mount)Acceptance
mounted;drivemountprocess and no half-mounted state.Implemented in
f414adc(lib/drive.js,test/drive.test.mjs); design corrected indocs/drive-auth.md.Key finding from the 0.8.0 source: the mount cannot appear before Enter — the CLI waits for the confirmation, then propagates credentials and mounts. The original scenario 4 ("detect the mount, then send Enter") is therefore impossible. The tool now runs a retry loop: surface the URL, wait a short operator grace, write
\n, close stdin, pollcolab ls, and retry while the operator clicks; the first attempt after consent succeeds.No PTY: the child is spawned detached so
/dev/ttyis unavailable and the CLI uses its documented stdin fallback. Timeout returnsauth_pending+ URL and kills the child. Tests cover instant mount, fail-then-consent-then-mount, timeout, and no wedged child.drive_path= mount dir,project_path=<mount>/MyDrive/<project>.Not yet verified against a real account (requires the operator's browser click); the fake CLI models the real ordering.