@hsupu/copilot-api 0.7.19 → 0.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,21 @@
2
2
  # Copy this file to ~/.local/share/copilot-api/config.yaml and customize as needed.
3
3
  # All settings are hot-reloadable unless noted otherwise.
4
4
 
5
+ # ============================================================================
6
+ # Proxy
7
+ # ============================================================================
8
+ # Proxy URL for all outgoing requests to GitHub / Copilot APIs.
9
+ # Supports http://, https://, socks5://, socks5h:// schemes.
10
+ # socks5h:// routes DNS through the proxy (recommended for privacy).
11
+ # Authentication via URL credentials: socks5h://user:pass@host:port
12
+ # Takes precedence over HTTP_PROXY/HTTPS_PROXY environment variables.
13
+ # CLI --proxy flag takes precedence over this setting.
14
+ # NOT hot-reloadable (requires restart).
15
+
16
+ # proxy: "http://127.0.0.1:7890"
17
+ # proxy: "socks5h://127.0.0.1:1080"
18
+ # proxy: "socks5h://user:pass@proxy.example.com:1080"
19
+
5
20
  # ============================================================================
6
21
  # Model
7
22
  # ============================================================================
@@ -33,21 +48,6 @@ model_overrides:
33
48
  claude-sonnet-4.5: claude-sonnet-4.6 # Latest sonnet
34
49
  claude-haiku-4.5: claude-sonnet-4.5 # Upgrade haiku to sonnet
35
50
 
36
- # ============================================================================
37
- # Proxy
38
- # ============================================================================
39
- # Proxy URL for all outgoing requests to GitHub / Copilot APIs.
40
- # Supports http://, https://, socks5://, socks5h:// schemes.
41
- # socks5h:// routes DNS through the proxy (recommended for privacy).
42
- # Authentication via URL credentials: socks5h://user:pass@host:port
43
- # Takes precedence over HTTP_PROXY/HTTPS_PROXY environment variables.
44
- # CLI --proxy flag takes precedence over this setting.
45
- # NOT hot-reloadable (requires restart).
46
-
47
- # proxy: "http://127.0.0.1:7890"
48
- # proxy: "socks5h://127.0.0.1:1080"
49
- # proxy: "socks5h://user:pass@proxy.example.com:1080"
50
-
51
51
  # ============================================================================
52
52
  # Timeouts
53
53
  # ============================================================================
@@ -56,7 +56,7 @@ model_overrides:
56
56
  stream_idle_timeout: 300 # Max seconds between SSE events (0 = no timeout).
57
57
  # Applies to all streaming paths (Anthropic, Chat Completions, Responses).
58
58
 
59
- fetch_timeout: 300 # Seconds: request start → HTTP response headers (0 = no timeout).
59
+ fetch_timeout: 600 # Seconds: request start → HTTP response headers (0 = no timeout).
60
60
  # Applies to all upstream API clients.
61
61
 
62
62
  stale_request_max_age: 600 # Max seconds an active request can live before the stale reaper
@@ -64,17 +64,22 @@ stale_request_max_age: 600 # Max seconds an active request can live before t
64
64
  # Safety net for requests that never complete/fail normally.
65
65
 
66
66
  # ============================================================================
67
- # Rate Limiter
67
+ # Shutdown
68
68
  # ============================================================================
69
- # Fine-tune the adaptive rate limiter behavior.
70
- # The rate limiter is enabled/disabled via --no-rate-limit CLI flag;
71
- # these settings control its parameters when enabled.
69
+ # Control graceful shutdown timing.
72
70
 
73
- rate_limiter:
74
- retry_interval: 10 # Seconds to wait before retrying after rate limit error
75
- request_interval: 10 # Seconds between requests in rate-limited mode
76
- recovery_timeout: 10 # Minutes before attempting recovery from rate-limited mode
77
- consecutive_successes: 5 # Consecutive successes needed to exit rate-limited mode
71
+ shutdown:
72
+ graceful_wait: 300 # Phase 2: seconds to wait for in-flight requests to complete naturally (default: 60)
73
+ abort_wait: 600 # Phase 3: seconds to wait after abort signal for handlers to wrap up (default: 120)
74
+
75
+ # ============================================================================
76
+ # History
77
+ # ============================================================================
78
+ # Control history recording behavior.
79
+
80
+ history:
81
+ limit: 200 # Maximum number of entries to keep in memory (0 = unlimited, default: 200)
82
+ min_entries: 50 # Minimum entries to keep even under memory pressure (default: 50)
78
83
 
79
84
  # ============================================================================
80
85
  # Anthropic
@@ -82,18 +87,39 @@ rate_limiter:
82
87
  # Settings for Anthropic API tool handling and timeouts.
83
88
 
84
89
  anthropic:
85
- convert_server_tools_to_custom: true # Convert server-side tools (web_search) to custom tool format
86
- dedup_tool_calls: false # false | "input" | "result" (true = "input" for compat)
87
- # "input": dedup by (name, input); "result": also require identical result
88
- truncate_read_tool_result: false # Strip <system-reminder> tags from Read tool results
89
- # rewrite_system_reminders: false # false = keep all (default), true = remove all
90
- rewrite_system_reminders: # Or provide rewrite rules (first match wins, top-down).
91
- # Note: `model` field is NOT supported here (only in system_prompt_overrides).
90
+ strip_server_tools: false # Strip server-side tools (web_search, etc.) from requests
91
+ dedup_tool_calls: false # false | "input" | "result" (true = "input" for compat)
92
+ # "input": dedup by (name, input); "result": also require identical result
93
+ strip_read_tool_result_tags: false # Strip <system-reminder> tags from Read tool results
94
+ context_editing: off # off | clear-thinking | clear-tooluse | clear-both
95
+ # Server-side context editing mode. Controls how Anthropic's
96
+ # context_management trims older context when input grows large.
97
+ # - off: disabled (default). No context_management sent.
98
+ # - clear-thinking: clear old thinking blocks.
99
+ # - clear-tooluse: clear old tool_use/result pairs.
100
+ # - clear-both: apply both clear-thinking and clear-tooluse.
101
+ # Only effective for models supporting context editing.
102
+ # rewrite_system_reminders: false # false = keep all (default), true = remove all
103
+ rewrite_system_reminders: # Or provide rewrite rules (first match wins, top-down).
104
+ # Note: `model` field is NOT supported here (only in system_prompt_overrides).
92
105
  - from: "^Whenever you read a file, you should consider whether it would be considered malware"
93
106
  to: "" # Empty = remove the tag
94
107
  # - from: ".*" # Catch-all: keep unchanged (gms flags are automatic)
95
108
  # to: "$0" # $0 = original content
96
109
 
110
+ # ============================================================================
111
+ # Rate Limiter
112
+ # ============================================================================
113
+ # Fine-tune the adaptive rate limiter behavior.
114
+ # The rate limiter is enabled/disabled via --no-rate-limit CLI flag;
115
+ # these settings control its parameters when enabled.
116
+
117
+ rate_limiter:
118
+ retry_interval: 10 # Seconds to wait before retrying after rate limit error
119
+ request_interval: 10 # Seconds between requests in rate-limited mode
120
+ recovery_timeout: 10 # Minutes before attempting recovery from rate-limited mode
121
+ consecutive_successes: 5 # Consecutive successes needed to exit rate-limited mode
122
+
97
123
  # ============================================================================
98
124
  # Auto-Truncate
99
125
  # ============================================================================
@@ -104,24 +130,6 @@ anthropic:
104
130
  # context size before resorting to message removal. Default: true.
105
131
  # compress_tool_results_before_truncate: false
106
132
 
107
- # ============================================================================
108
- # History
109
- # ============================================================================
110
- # Control history recording behavior.
111
-
112
- # Maximum number of history entries to keep in memory.
113
- # 0 = unlimited. Default: 200.
114
- history_limit: 200
115
-
116
- # ============================================================================
117
- # Shutdown
118
- # ============================================================================
119
- # Control graceful shutdown timing.
120
-
121
- shutdown:
122
- graceful_wait: 60 # Phase 2: seconds to wait for in-flight requests to complete naturally (default: 60)
123
- abort_wait: 120 # Phase 3: seconds to wait after abort signal for handlers to wrap up (default: 120)
124
-
125
133
  # ============================================================================
126
134
  # System Prompt
127
135
  # ============================================================================