Skip to content

Standardize timeout parameter naming to clarify units#304

Merged
jancurn merged 2 commits into
mainfrom
claude/timeout-variable-naming-eqajky
Jul 13, 2026
Merged

Standardize timeout parameter naming to clarify units#304
jancurn merged 2 commits into
mainfrom
claude/timeout-variable-naming-eqajky

Conversation

@jancurn

@jancurn jancurn commented Jul 13, 2026

Copy link
Copy Markdown
Member

Internal duration values travelled under bare names like timeout — seconds in the CLI/IPC layer, milliseconds in the core client — so the unit had to be inferred from context. This unifies all internal duration names under one convention: ...Secs/...Millis for variables and fields, ..._SECS/..._MILLIS for constants, converting units at the boundary where external values enter. No user-visible behavior change.

  • External surfaces unchanged: --timeout flag, timeout field in mcp.json/sessions.json, ping's durationMs JSON output, SDK/Node/library option names, wire-format fields (x402 maxTimeoutSeconds, OAuth expires_in)
  • Already unit-explicit ...Seconds names mirroring protocol vocabulary are left as-is
  • The CLI→bridge IPC request field is renamed timeouttimeoutSecs; a mixed-version CLI/bridge pair falls back to the default request timeout until the bridge restarts
  • Convention documented in CLAUDE.md (new implementation pattern chore(deps): update actions/checkout action to v6 #15)

Verified with lint, build, all 862 unit tests, and a live smoke test of connect/tools-call with --timeout against the e2e server.

https://claude.ai/code/session_01DndLCCyhJFcYsLP1EDZDms

claude added 2 commits July 13, 2026 10:36
Duration values previously travelled under bare names like `timeout`
(seconds in the CLI/IPC layer, milliseconds in the core client) plus a
mix of `Ms`/`_MS` suffixes. Rename all internal identifiers to a single
convention: `...Secs`/`...Millis` for variables and fields,
`..._SECS`/`..._MILLIS` for constants.

External surfaces are unchanged: the `--timeout` flag, the `timeout`
field in mcp.json / sessions.json (ServerConfig), the ping command's
`durationMs` JSON output, MCP SDK request options, Node/library options,
and wire-format fields (x402 `maxTimeoutSeconds`, OAuth `expires_in`).
Already unit-explicit `...Seconds` names that mirror protocol vocabulary
are also left as-is. The convention is documented in CLAUDE.md.

Note: the CLI→bridge IPC request field is renamed `timeout` →
`timeoutSecs`; a mixed-version CLI/bridge pair would fall back to the
default request timeout until the bridge restarts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DndLCCyhJFcYsLP1EDZDms
Follow-up sweep beyond `timeout`: `expiryOverride` → `expiryOverrideSecs`
(x402 signer input, holds seconds), `parseDuration()` →
`parseDurationMillis()`, `sleep(ms)`/`formatElapsed(ms)` → `millis`,
local `durationMs`/`expiresIn` → `durationMillis`/`expiresInSecs`, and
`fileAge` → `fileMtimeMillis` (it holds an mtime timestamp, not an age).

Kept: the persisted keychain token field `expiresIn`, the ping command's
`durationMs` JSON output field, and the e2e server's `LATENCY_MS` env var
— all externally visible names.

Refs #304

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DndLCCyhJFcYsLP1EDZDms
@jancurn
jancurn merged commit 8448433 into main Jul 13, 2026
6 checks passed
@jancurn
jancurn deleted the claude/timeout-variable-naming-eqajky branch July 13, 2026 11:44
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.

3 participants