Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
claude-code/src/bridge/pollConfigDefaults.ts at main · ssw-python/claude-code · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ssw-python
claude-code
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
claude-code
/
src
/
bridge
/
pollConfigDefaults.ts
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
82 lines (77 loc) · 3.92 KB
main
Breadcrumbs
claude-code
/
src
/
bridge
/
pollConfigDefaults.ts
Copy path
Top
File metadata and controls
Code
Blame
82 lines (77 loc) · 3.92 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* Bridge poll interval defaults. Extracted from pollConfig.ts so callers
* that don't need live GrowthBook tuning (daemon via Agent SDK) can avoid
* the growthbook.ts → config.ts → file.ts → sessionStorage.ts → commands.ts
* transitive dependency chain.
*/
/**
* Poll interval when actively seeking work (no transport / below maxSessions).
* Governs user-visible "connecting…" latency on initial work pickup and
* recovery speed after the server re-dispatches a work item.
*/
const
POLL_INTERVAL_MS_NOT_AT_CAPACITY
=
2000
/**
* Poll interval when the transport is connected. Runs independently of
* heartbeat — when both are enabled, the heartbeat loop breaks out to poll
* at this interval. Set to 0 to disable at-capacity polling entirely.
*
* Server-side constraints that bound this value:
* - BRIDGE_LAST_POLL_TTL = 4h (Redis key expiry → environment auto-archived)
* - max_poll_stale_seconds = 24h (session-creation health gate, currently disabled)
*
* 10 minutes gives 24× headroom on the Redis TTL while still picking up
* server-initiated token-rotation redispatches within one poll cycle.
* The transport auto-reconnects internally for 10 minutes on transient WS
* failures, so poll is not the recovery path — it's strictly a liveness
* signal plus a backstop for permanent close.
*/
const
POLL_INTERVAL_MS_AT_CAPACITY
=
600_000
/**
* Multisession bridge (bridgeMain.ts) poll intervals. Defaults match the
* single-session values so existing GrowthBook configs without these fields
* preserve current behavior. Ops can tune these independently via the
* tengu_bridge_poll_interval_config GB flag.
*/
const
MULTISESSION_POLL_INTERVAL_MS_NOT_AT_CAPACITY
=
POLL_INTERVAL_MS_NOT_AT_CAPACITY
const
MULTISESSION_POLL_INTERVAL_MS_PARTIAL_CAPACITY
=
POLL_INTERVAL_MS_NOT_AT_CAPACITY
const
MULTISESSION_POLL_INTERVAL_MS_AT_CAPACITY
=
POLL_INTERVAL_MS_AT_CAPACITY
export
type
PollIntervalConfig
=
{
poll_interval_ms_not_at_capacity
:
number
poll_interval_ms_at_capacity
:
number
non_exclusive_heartbeat_interval_ms
:
number
multisession_poll_interval_ms_not_at_capacity
:
number
multisession_poll_interval_ms_partial_capacity
:
number
multisession_poll_interval_ms_at_capacity
:
number
reclaim_older_than_ms
:
number
session_keepalive_interval_v2_ms
:
number
}
export
const
DEFAULT_POLL_CONFIG
:
PollIntervalConfig
=
{
poll_interval_ms_not_at_capacity
:
POLL_INTERVAL_MS_NOT_AT_CAPACITY
,
poll_interval_ms_at_capacity
:
POLL_INTERVAL_MS_AT_CAPACITY
,
// 0 = disabled. When > 0, at-capacity loops send per-work-item heartbeats
// at this interval. Independent of poll_interval_ms_at_capacity — both may
// run (heartbeat periodically yields to poll). 60s gives 5× headroom under
// the server's 300s heartbeat TTL. Named non_exclusive to distinguish from
// the old heartbeat_interval_ms field (either-or semantics in pre-#22145
// clients — heartbeat suppressed poll). Old clients ignore this key; ops
// can set both fields during rollout.
non_exclusive_heartbeat_interval_ms
:
0
,
multisession_poll_interval_ms_not_at_capacity
:
MULTISESSION_POLL_INTERVAL_MS_NOT_AT_CAPACITY
,
multisession_poll_interval_ms_partial_capacity
:
MULTISESSION_POLL_INTERVAL_MS_PARTIAL_CAPACITY
,
multisession_poll_interval_ms_at_capacity
:
MULTISESSION_POLL_INTERVAL_MS_AT_CAPACITY
,
// Poll query param: reclaim unacknowledged work items older than this.
// Matches the server's DEFAULT_RECLAIM_OLDER_THAN_MS (work_service.py:24).
// Enables picking up stale-pending work after JWT expiry, when the prior
// ack failed because the session_ingress_token was already stale.
reclaim_older_than_ms
:
5000
,
// 0 = disabled. When > 0, push a silent {type:'keep_alive'} frame to
// session-ingress at this interval so upstream proxies don't GC an idle
// remote-control session. 2 min is the default. _v2: bridge-only gate
// (pre-v2 clients read the old key, new clients ignore it).
session_keepalive_interval_v2_ms
:
120_000
,
}
You can’t perform that action at this time.