Problem
After successfully completing OAuth flow and obtaining a fresh access token, the V2 API authentication fails with a 429 rate limit error during client.connect().
Steps to Reproduce
- Run
ticktick-sdk auth --manual with fresh OAuth credentials
- Successfully complete OAuth flow → obtain new access token
- Set environment variables with new credentials:
TICKTICK_CLIENT_ID
TICKTICK_CLIENT_SECRET
TICKTICK_ACCESS_TOKEN (fresh token)
TICKTICK_USERNAME
TICKTICK_PASSWORD
- Initialize client:
client = TickTickClient.from_settings()
- Call
await client.connect()
Error
Failed to initialize V2 client: Authentication failed: | Details: {'status_code': 429, 'response': '', 'requires_2fa': False}
TickTickConfigurationError: Both V1 and V2 APIs are required. V2 initialization failed: Authentication failed: | Details: {'status_code': 429, 'response': '', 'requires_2fa': False}; V2 authentication verification failed
Full Traceback
Traceback (most recent call last):
File "/Users/kj/clawd/skills/ticktick/scripts/tt.py", line 265, in <module>
asyncio.run(main())
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
File "/Users/kj/clawd/skills/ticktick/scripts/tt.py", line 221, in main
await tasks_today()
File "/Users/kj/clawd/skills/ticktick/scripts/tt.py", line 106, in tasks_today
await tasks_for_date(date.today(), "today")
File "/Users/kj/clawd/skills/ticktick/scripts/tt.py", line 58, in tasks_for_date
await client.connect()
File "/Users/kj/agents/ticktick-sdk/src/ticktick_sdk/client/client.py", line 131, in connect
await self._api.initialize()
File "/Users/kj/agents/ticktick-sdk/src/ticktick_sdk/unified/api.py", line 336, in initialize
raise TickTickConfigurationError(...)
Context
- V1 OAuth completed successfully
- Fresh access token obtained via
ticktick-sdk auth --manual
- 429 error occurs specifically during V2 API authentication/verification
- Happens immediately after OAuth flow (within seconds)
Expected Behavior
Client should initialize successfully with fresh credentials, or provide clearer error messaging about rate limits and retry strategy.
Questions
- Should there be retry logic with exponential backoff for 429 errors during initialization?
- Is the V2 authentication hitting rate limits because we just completed OAuth flow moments before?
- Should the SDK cache/reuse authentication to avoid hitting limits during rapid reconnects?
Environment
- Python: 3.12
- ticktick-sdk: latest from local clone (
/Users/kj/agents/ticktick-sdk)
- OS: macOS
Problem
After successfully completing OAuth flow and obtaining a fresh access token, the V2 API authentication fails with a 429 rate limit error during
client.connect().Steps to Reproduce
ticktick-sdk auth --manualwith fresh OAuth credentialsTICKTICK_CLIENT_IDTICKTICK_CLIENT_SECRETTICKTICK_ACCESS_TOKEN(fresh token)TICKTICK_USERNAMETICKTICK_PASSWORDclient = TickTickClient.from_settings()await client.connect()Error
Full Traceback
Context
ticktick-sdk auth --manualExpected Behavior
Client should initialize successfully with fresh credentials, or provide clearer error messaging about rate limits and retry strategy.
Questions
Environment
/Users/kj/agents/ticktick-sdk)