Skip to content

Commit f97270b

Browse files
dcramercodex
andcommitted
Extend Google auth flow TTL and harden expired-flow handling
Increase default capability auth-flow TTL to 30 minutes for Google bridge + manager fallback, add explicit skill guidance for expired/invalid flow messaging, and assert minimum TTL in gog bridge tests. Co-Authored-By: GPT-5 Codex <codex@openai.com>
1 parent 345e2cd commit f97270b

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/ash/capabilities/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CapabilityManager:
6565
def __init__(
6666
self,
6767
*,
68-
auth_flow_ttl_seconds: int = 600,
68+
auth_flow_ttl_seconds: int = 1800,
6969
) -> None:
7070
self._lock = asyncio.Lock()
7171
self._definitions: dict[str, CapabilityDefinition] = {}

src/ash/integrations/skills/capabilities/google/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ Before prompting the user again, check whether the current task already contains
6969

7070
Do not ask the user for another URL/code when one is already present in the task.
7171

72+
If `auth complete` fails with an invalid/expired flow error, explicitly tell the user
73+
their previous auth link/code expired (or no longer matches the active flow), then
74+
start a fresh auth flow and ask them to paste the new callback URL promptly.
75+
7276
**2a. Begin auth flow**
7377

7478
Use `--account work` or `--account personal` if the user specifies an account preference:

src/ash/skills/bundled/gog/scripts/gogcli_bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
DEFAULT_STATE_PATH = Path.home() / ".ash" / "gogcli" / "state.json"
3737
VAULT_NAMESPACE = "gog.credentials"
3838
STATE_VERSION = 1
39-
DEFAULT_AUTH_FLOW_TTL_SECONDS = 600
39+
DEFAULT_AUTH_FLOW_TTL_SECONDS = 1800
4040
MIN_AUTH_FLOW_TTL_SECONDS = 30
4141
MAX_AUTH_FLOW_TTL_SECONDS = 3600
4242
ENV_GOOGLE_CLIENT_ID = "GOOGLE_CLIENT_ID"

tests/test_gogcli_bridge.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
import sys
66
import threading
7+
import time
78
from http.server import BaseHTTPRequestHandler, HTTPServer
89
from pathlib import Path
910
from typing import Any
@@ -374,6 +375,8 @@ def test_bridge_auth_code_flow_and_user_scoped_invoke(
374375
stored_flow = state_after_begin["auth_flows"][flow_state["flow_id"]]
375376
assert stored_flow["flow_type"] == "authorization_code"
376377
assert stored_flow["state_param"]
378+
# Flows should remain valid long enough for real-world consent latency.
379+
assert int(stored_flow["expires_at"]) - int(time.time()) >= 25 * 60
377380

378381
# auth_complete exchanges code for tokens
379382
complete = _run_bridge(

0 commit comments

Comments
 (0)