-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwellcode_debug.log
More file actions
493 lines (493 loc) · 164 KB
/
wellcode_debug.log
File metadata and controls
493 lines (493 loc) · 164 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
2024-11-28 14:22:32,533 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:22:32,534 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:22:39,751 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:22:39,788 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:22:39,789 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:22:39,802 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11658da90>
2024-11-28 14:22:39,802 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x116551010> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:22:39,813 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1165a8690>
2024-11-28 14:22:39,813 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:22:39,814 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:22:39,814 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:22:39,814 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:22:39,814 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:22:41,256 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:22:41 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:22:39Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:22:41Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:22:41Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:22:41Z'), (b'request-id', b'req_015r2zzE76KcBytae7dszwrc'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cba5f3ed6ac6c-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:22:41,259 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:22:41,259 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:22:41,260 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:22:41,260 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:22:41,260 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:22:41,260 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:22:41 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:22:39Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:22:41Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:22:41Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:22:41Z', 'request-id': 'req_015r2zzE76KcBytae7dszwrc', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cba5f3ed6ac6c-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:22:41,261 - anthropic._base_client - DEBUG - request_id: req_015r2zzE76KcBytae7dszwrc
2024-11-28 14:23:38,826 - httpcore.connection - DEBUG - close.started
2024-11-28 14:23:38,826 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:23:40,888 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:23:40,889 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:23:48,815 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:23:48,853 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:23:48,853 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:23:48,868 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x114291a90>
2024-11-28 14:23:48,868 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1142590a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:23:48,879 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1142ac690>
2024-11-28 14:23:48,880 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:23:48,881 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:23:48,882 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:23:48,882 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:23:48,883 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:23:50,273 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:23:50 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:23:49Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:23:50Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:23:50Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:23:50Z'), (b'request-id', b'req_01Y49YxVdd6osVf6CP3G1wLp'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbc0eea6a39fa-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:23:50,275 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:23:50,275 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:23:50,276 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:23:50,276 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:23:50,276 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:23:50,276 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:23:50 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:23:49Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:23:50Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:23:50Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:23:50Z', 'request-id': 'req_01Y49YxVdd6osVf6CP3G1wLp', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbc0eea6a39fa-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:23:50,277 - anthropic._base_client - DEBUG - request_id: req_01Y49YxVdd6osVf6CP3G1wLp
2024-11-28 14:24:14,429 - httpcore.connection - DEBUG - close.started
2024-11-28 14:24:14,430 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:24:16,533 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:24:16,534 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:24:21,581 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:24:21,618 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:24:21,619 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:24:21,634 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x112df5a90>
2024-11-28 14:24:21,634 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x112db50a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:24:21,648 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x112e0c690>
2024-11-28 14:24:21,648 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:24:21,649 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:24:21,649 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:24:21,650 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:24:21,650 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:24:22,797 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:24:22 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:24:21Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:24:22Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:24:22Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:24:22Z'), (b'request-id', b'req_0168G2SnSWSkwjw4AhZS81Jq'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbcdbaa22aaba-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:24:22,799 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:24:22,799 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:24:22,799 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:24:22,800 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:24:22,800 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:24:22,800 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:24:22 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:24:21Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:24:22Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:24:22Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:24:22Z', 'request-id': 'req_0168G2SnSWSkwjw4AhZS81Jq', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbcdbaa22aaba-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:24:22,800 - anthropic._base_client - DEBUG - request_id: req_0168G2SnSWSkwjw4AhZS81Jq
2024-11-28 14:24:22,809 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review
2024-11-28 14:24:22,809 - wellcode_cli.commands.chat_interface - DEBUG - Command string type before parsing: <class 'str'>
2024-11-28 14:24:22,809 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: review
2024-11-28 14:24:22,809 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:24:22,809 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command: review
2024-11-28 14:24:36,038 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:24:36,039 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:24:36,039 - httpcore.connection - DEBUG - close.started
2024-11-28 14:24:36,040 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:24:36,040 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:24:36,046 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x112e0d810>
2024-11-28 14:24:36,046 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x112db50a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:24:36,059 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x112d7ad70>
2024-11-28 14:24:36,059 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:24:36,060 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:24:36,060 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:24:36,060 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:24:36,060 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:24:37,582 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:24:37 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:24:36Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:24:37Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:24:37Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:24:37Z'), (b'request-id', b'req_01UctPyRWgsrjXPpzEyv76ZN'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbd35ceb4a205-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:24:37,583 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:24:37,583 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:24:37,583 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:24:37,583 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:24:37,584 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:24:37,584 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:24:37 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:24:36Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:24:37Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:24:37Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:24:37Z', 'request-id': 'req_01UctPyRWgsrjXPpzEyv76ZN', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbd35ceb4a205-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:24:37,584 - anthropic._base_client - DEBUG - request_id: req_01UctPyRWgsrjXPpzEyv76ZN
2024-11-28 14:24:37,585 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:24:37,585 - wellcode_cli.commands.chat_interface - DEBUG - Command string type before parsing: <class 'str'>
2024-11-28 14:24:37,585 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:24:37,585 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:24:37,585 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:24:58,097 - httpcore.connection - DEBUG - close.started
2024-11-28 14:24:58,098 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:24:59,841 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:24:59,842 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:25:05,986 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:25:06,022 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:25:06,023 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:25:06,043 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x115015a90>
2024-11-28 14:25:06,044 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x114fd90a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:25:06,060 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x115030690>
2024-11-28 14:25:06,060 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:25:06,061 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:25:06,061 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:25:06,062 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:25:06,062 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:25:07,482 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:25:07 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:25:06Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:25:07Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:25:07Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:25:07Z'), (b'request-id', b'req_01MewVoVprpYQD11aFUP5L1M'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbdf14d3f3a00-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:25:07,484 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:25:07,484 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:25:07,484 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:25:07,485 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:25:07,485 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:25:07,485 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:25:07 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:25:06Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:25:07Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:25:07Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:25:07Z', 'request-id': 'req_01MewVoVprpYQD11aFUP5L1M', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbdf14d3f3a00-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:25:07,486 - anthropic._base_client - DEBUG - request_id: req_01MewVoVprpYQD11aFUP5L1M
2024-11-28 14:25:07,495 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:25:07,495 - wellcode_cli.commands.chat_interface - DEBUG - Command string type before parsing: <class 'str'>
2024-11-28 14:25:07,495 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:25:07,495 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:25:07,495 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command: review --start-date 2024-11-21 --end-date 2024-11-28 with error: cannot unpack non-iterable NoneType object
2024-11-28 14:25:42,586 - httpcore.connection - DEBUG - close.started
2024-11-28 14:25:42,587 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:25:44,491 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:25:44,492 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:25:49,896 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:25:49,937 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:25:49,937 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:25:49,952 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x115f2da90>
2024-11-28 14:25:49,952 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x115eed0a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:25:49,964 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x115f44690>
2024-11-28 14:25:49,964 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:25:49,965 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:25:49,965 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:25:49,965 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:25:49,965 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:25:51,127 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:25:51 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:25:50Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:25:51Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:25:51Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:25:51Z'), (b'request-id', b'req_01USvu85Ltt23wjv2tHMzgjW'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbf03af0f39ea-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:25:51,129 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:25:51,130 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:25:51,130 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:25:51,131 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:25:51,131 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:25:51,131 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:25:51 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:25:50Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:25:51Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:25:51Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:25:51Z', 'request-id': 'req_01USvu85Ltt23wjv2tHMzgjW', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbf03af0f39ea-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:25:51,131 - anthropic._base_client - DEBUG - request_id: req_01USvu85Ltt23wjv2tHMzgjW
2024-11-28 14:25:51,143 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:25:51,143 - wellcode_cli.commands.chat_interface - DEBUG - Command string type before parsing: <class 'str'>
2024-11-28 14:25:51,143 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:25:51,143 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:25:51,143 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command: review --start-date 2024-11-21 --end-date 2024-11-28 with error: cannot unpack non-iterable NoneType object
2024-11-28 14:26:08,159 - httpcore.connection - DEBUG - close.started
2024-11-28 14:26:08,160 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:26:10,130 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:26:10,131 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:26:16,138 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:26:16,176 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:26:16,177 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:26:16,186 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10c759be0>
2024-11-28 14:26:16,186 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10c7210a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:26:16,200 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10c77c550>
2024-11-28 14:26:16,201 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:26:16,201 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:26:16,201 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:26:16,202 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:26:16,202 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:26:17,625 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:26:17 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:26:16Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:26:17Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:26:17Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:26:17Z'), (b'request-id', b'req_01VMS7WFCYL8jz63fYviMBvF'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cbfa7ab9539f7-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:26:17,627 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:26:17,628 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:26:17,628 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:26:17,628 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:26:17,628 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:26:17,629 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:26:17 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:26:16Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:26:17Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:26:17Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:26:17Z', 'request-id': 'req_01VMS7WFCYL8jz63fYviMBvF', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cbfa7ab9539f7-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:26:17,629 - anthropic._base_client - DEBUG - request_id: req_01VMS7WFCYL8jz63fYviMBvF
2024-11-28 14:26:17,638 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:26:17,638 - wellcode_cli.commands.chat_interface - DEBUG - Command string type before parsing: <class 'str'>
2024-11-28 14:26:17,638 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:26:17,638 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:26:17,638 - wellcode_cli.commands.chat_interface - DEBUG - parse_command returned: None
2024-11-28 14:26:17,638 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command - received None
2024-11-28 14:26:40,463 - httpcore.connection - DEBUG - close.started
2024-11-28 14:26:40,464 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:26:42,512 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:26:42,512 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:26:48,324 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:26:48,359 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:26:48,360 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:26:48,367 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x109501be0>
2024-11-28 14:26:48,367 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1094c50a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:26:48,383 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x109524550>
2024-11-28 14:26:48,384 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:26:48,384 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:26:48,384 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:26:48,384 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:26:48,384 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:26:49,516 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:26:49 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:26:48Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:26:49Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:26:49Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:26:49Z'), (b'request-id', b'req_01SwjQohHMVuo228uGUxyQcS'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cc070cd8eab9a-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:26:49,517 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:26:49,518 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:26:49,518 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:26:49,519 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:26:49,519 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:26:49,519 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:26:49 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:26:48Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:26:49Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:26:49Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:26:49Z', 'request-id': 'req_01SwjQohHMVuo228uGUxyQcS', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cc070cd8eab9a-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:26:49,519 - anthropic._base_client - DEBUG - request_id: req_01SwjQohHMVuo228uGUxyQcS
2024-11-28 14:26:49,529 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Handling review command directly: ['review', '--start-date', '2024-11-21', '--end-date', '2024-11-28']
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Parsed command_type: <enum 'CommandType'>
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Parsed args type: <class 'list'>
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Parsed time_range type: <class 'NoneType'>
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - command_type value: CommandType.REVIEW
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - args value: []
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - time_range value: None
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Command context created
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Matched REVIEW command type
2024-11-28 14:26:49,530 - wellcode_cli.commands.chat_interface - DEBUG - Executing REVIEW command
2024-11-28 14:26:49,538 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.github.com:443
2024-11-28 14:26:49,787 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:26:49,932 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:26:50,064 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:26:50,065 - root - ERROR - Error getting GitHub metrics: 'Github' object has no attribute 'get_requester'
2024-11-28 14:26:50,069 - markdown_it.rules_block.code - DEBUG - entering code: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.fence - DEBUG - entering fence: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.blockquote - DEBUG - entering blockquote: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.hr - DEBUG - entering hr: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.list - DEBUG - entering list: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.reference - DEBUG - entering reference: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.html_block - DEBUG - entering html_block: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.heading - DEBUG - entering heading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,069 - markdown_it.rules_block.lheading - DEBUG - entering lheading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:26:50,070 - markdown_it.rules_block.paragraph - DEBUG - entering paragraph: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:27:03,075 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: report'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:27:03,077 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:27:03,077 - httpcore.connection - DEBUG - close.started
2024-11-28 14:27:03,077 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:27:03,078 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:27:03,089 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x109525950>
2024-11-28 14:27:03,090 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1094c50a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:27:03,102 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x109486fd0>
2024-11-28 14:27:03,102 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:27:03,102 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:27:03,102 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:27:03,103 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:27:03,103 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:27:04,319 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:27:04 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:27:03Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:27:04Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:27:04Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:27:04Z'), (b'request-id', b'req_01FodKaGFpCTN6oCRKCWDZ3b'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cc0cccb91ab7c-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:27:04,321 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:27:04,321 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:27:04,322 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:27:04,322 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:27:04,322 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:27:04,322 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:27:04 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:27:03Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:27:04Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:27:04Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:27:04Z', 'request-id': 'req_01FodKaGFpCTN6oCRKCWDZ3b', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cc0cccb91ab7c-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:27:04,323 - anthropic._base_client - DEBUG - request_id: req_01FodKaGFpCTN6oCRKCWDZ3b
2024-11-28 14:27:04,324 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: report
2024-11-28 14:27:04,324 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: report
2024-11-28 14:27:04,324 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:27:04,324 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command - received None
2024-11-28 14:27:06,797 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: report'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:27:06,799 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:27:06,799 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:27:06,800 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:27:06,800 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:27:06,800 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:27:06,800 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:27:07,957 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:27:07 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:27:06Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:27:08Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:27:07Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:27:07Z'), (b'request-id', b'req_01SK3Cr1Ws3qZGxr67K1cjVA'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cc0e3fc7cab7c-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:27:07,959 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:27:07,959 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:27:07,960 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:27:07,960 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:27:07,960 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:27:07,960 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:27:07 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:27:06Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:27:08Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:27:07Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:27:07Z', 'request-id': 'req_01SK3Cr1Ws3qZGxr67K1cjVA', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cc0e3fc7cab7c-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:27:07,961 - anthropic._base_client - DEBUG - request_id: req_01SK3Cr1Ws3qZGxr67K1cjVA
2024-11-28 14:27:07,962 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: report
2024-11-28 14:27:07,963 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: report
2024-11-28 14:27:07,963 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:27:07,963 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command - received None
2024-11-28 14:27:32,602 - httpcore.connection - DEBUG - close.started
2024-11-28 14:27:32,603 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:27:35,008 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:27:35,008 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:27:36,693 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: report'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:27:36,726 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:27:36,727 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:27:36,740 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10a625be0>
2024-11-28 14:27:36,740 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10a5e50a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:27:36,752 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10a648550>
2024-11-28 14:27:36,753 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:27:36,753 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:27:36,753 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:27:36,753 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:27:36,753 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:27:37,961 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:27:37 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:27:36Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:27:38Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:27:37Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:27:37Z'), (b'request-id', b'req_01CEFQBxzvWaLQMYDd64HKqA'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cc19f1e15aba2-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:27:37,964 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:27:37,965 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:27:37,965 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:27:37,965 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:27:37,966 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:27:37,966 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:27:37 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:27:36Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:27:38Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:27:37Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:27:37Z', 'request-id': 'req_01CEFQBxzvWaLQMYDd64HKqA', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cc19f1e15aba2-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:27:37,966 - anthropic._base_client - DEBUG - request_id: req_01CEFQBxzvWaLQMYDd64HKqA
2024-11-28 14:27:37,976 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: report
2024-11-28 14:27:37,976 - wellcode_cli.commands.chat_interface - DEBUG - Parsed command_type: <enum 'CommandType'>
2024-11-28 14:27:37,976 - wellcode_cli.commands.chat_interface - DEBUG - Parsed args type: <class 'list'>
2024-11-28 14:27:37,976 - wellcode_cli.commands.chat_interface - DEBUG - Parsed time_range type: <class 'NoneType'>
2024-11-28 14:27:37,977 - wellcode_cli.commands.chat_interface - DEBUG - command_type value: CommandType.REPORT
2024-11-28 14:27:37,977 - wellcode_cli.commands.chat_interface - DEBUG - args value: []
2024-11-28 14:27:37,977 - wellcode_cli.commands.chat_interface - DEBUG - time_range value: None
2024-11-28 14:27:37,977 - wellcode_cli.commands.chat_interface - DEBUG - Command context created
2024-11-28 14:27:41,946 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: chat'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:27:41,947 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:27:41,948 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:27:41,948 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:27:41,948 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:27:41,948 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:27:41,948 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:27:43,025 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:27:43 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:27:42Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:27:43Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:27:43Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:27:43Z'), (b'request-id', b'req_017LRMNebXj6ePCAbBbq8qyd'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cc1bf9f9baba2-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:27:43,026 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:27:43,027 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:27:43,028 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:27:43,028 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:27:43,028 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:27:43,028 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:27:43 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:27:42Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:27:43Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:27:43Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:27:43Z', 'request-id': 'req_017LRMNebXj6ePCAbBbq8qyd', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cc1bf9f9baba2-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:27:43,028 - anthropic._base_client - DEBUG - request_id: req_017LRMNebXj6ePCAbBbq8qyd
2024-11-28 14:27:43,030 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: chat
2024-11-28 14:27:43,030 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: chat
2024-11-28 14:27:43,030 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:27:43,030 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command - received None
2024-11-28 14:38:14,743 - httpcore.connection - DEBUG - close.started
2024-11-28 14:38:14,744 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:39:34,387 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:39:34,387 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:39:44,239 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:39:44,282 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:39:44,282 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:39:44,308 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x115069be0>
2024-11-28 14:39:44,309 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1150310a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:39:44,320 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11508c550>
2024-11-28 14:39:44,320 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:39:44,321 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:39:44,321 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:39:44,321 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:39:44,322 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:39:45,936 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:39:45 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:39:44Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:39:45Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:39:45Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:39:45Z'), (b'request-id', b'req_01BTsaDBaeEthRdwwKVhA8KW'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cd3621e7a36fb-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:39:45,938 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:39:45,939 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:39:45,939 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:39:45,940 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:39:45,940 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:39:45,940 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:39:45 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:39:44Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:39:45Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:39:45Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:39:45Z', 'request-id': 'req_01BTsaDBaeEthRdwwKVhA8KW', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cd3621e7a36fb-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:39:45,941 - anthropic._base_client - DEBUG - request_id: req_01BTsaDBaeEthRdwwKVhA8KW
2024-11-28 14:39:45,950 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - Parsed command_type: <enum 'CommandType'>
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - Parsed args type: <class 'list'>
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - Parsed time_range type: <class 'NoneType'>
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - command_type value: CommandType.REVIEW
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - args value: []
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - time_range value: None
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - Command context created
2024-11-28 14:39:45,951 - wellcode_cli.commands.chat_interface - DEBUG - Matched REVIEW command type
2024-11-28 14:39:45,952 - wellcode_cli.commands.chat_interface - DEBUG - Executing REVIEW command
2024-11-28 14:39:45,959 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.github.com:443
2024-11-28 14:39:46,194 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:39:46,342 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:39:46,501 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:39:46,502 - root - ERROR - Error getting GitHub metrics: 'Github' object has no attribute 'get_requester'
2024-11-28 14:39:46,506 - markdown_it.rules_block.code - DEBUG - entering code: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,506 - markdown_it.rules_block.fence - DEBUG - entering fence: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,506 - markdown_it.rules_block.blockquote - DEBUG - entering blockquote: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,506 - markdown_it.rules_block.hr - DEBUG - entering hr: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.list - DEBUG - entering list: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.reference - DEBUG - entering reference: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.html_block - DEBUG - entering html_block: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.heading - DEBUG - entering heading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.lheading - DEBUG - entering lheading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:39:46,507 - markdown_it.rules_block.paragraph - DEBUG - entering paragraph: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:04,068 - httpcore.connection - DEBUG - close.started
2024-11-28 14:42:04,069 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:42:06,457 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:42:06,458 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:42:18,113 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team in the last week'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:42:18,147 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:42:18,147 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:42:18,161 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1145b9be0>
2024-11-28 14:42:18,162 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1145790a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:42:18,176 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1145d8550>
2024-11-28 14:42:18,176 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:42:18,177 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:42:18,177 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:42:18,177 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:42:18,177 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:42:19,638 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:42:19 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:42:18Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:42:19Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:42:19Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:42:19Z'), (b'request-id', b'req_018t3Tn7VpLEAbUkf6tsaDam'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cd723bb1036b7-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:42:19,641 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:42:19,641 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:42:19,642 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:42:19,642 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:42:19,642 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:42:19,642 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:42:19 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:42:18Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:42:19Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:42:19Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:42:19Z', 'request-id': 'req_018t3Tn7VpLEAbUkf6tsaDam', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cd723bb1036b7-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:42:19,643 - anthropic._base_client - DEBUG - request_id: req_018t3Tn7VpLEAbUkf6tsaDam
2024-11-28 14:42:19,653 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-21 --end-date 2024-11-28
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Parsed command_type: <enum 'CommandType'>
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Parsed args type: <class 'list'>
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Parsed time_range type: <class 'NoneType'>
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - command_type value: CommandType.REVIEW
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - args value: ['--start-date', '2024-11-21', '--end-date', '2024-11-28']
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - time_range value: None
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Command context created
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Matched REVIEW command type
2024-11-28 14:42:19,654 - wellcode_cli.commands.chat_interface - DEBUG - Executing REVIEW command
2024-11-28 14:42:19,659 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.github.com:443
2024-11-28 14:42:19,883 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:42:20,008 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:42:20,013 - markdown_it.rules_block.code - DEBUG - entering code: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,013 - markdown_it.rules_block.fence - DEBUG - entering fence: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.blockquote - DEBUG - entering blockquote: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.hr - DEBUG - entering hr: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.list - DEBUG - entering list: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.reference - DEBUG - entering reference: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.html_block - DEBUG - entering html_block: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.heading - DEBUG - entering heading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,014 - markdown_it.rules_block.lheading - DEBUG - entering lheading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:20,015 - markdown_it.rules_block.paragraph - DEBUG - entering paragraph: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:46,099 - httpcore.connection - DEBUG - close.started
2024-11-28 14:42:46,100 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:42:48,419 - httpx - DEBUG - load_ssl_context verify=True cert=None trust_env=True http2=False
2024-11-28 14:42:48,420 - httpx - DEBUG - load_verify_locations cafile='/Users/yan/github.com/wellcode-ai/wellcode-cli/venv/lib/python3.13/site-packages/certifi/cacert.pem'
2024-11-28 14:42:56,759 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: check performance of the team in the last three weeks'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:42:56,796 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:42:56,797 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:42:56,807 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10d4ddbe0>
2024-11-28 14:42:56,807 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10d4a10a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:42:56,821 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10d4fc550>
2024-11-28 14:42:56,822 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:42:56,822 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:42:56,823 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:42:56,823 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:42:56,823 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:42:57,966 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:42:57 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:42:56Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:42:58Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:42:57Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:42:57Z'), (b'request-id', b'req_01WjeLNPVW8H9xC4j5rjRHA2'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cd8154db9ab2a-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:42:57,968 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:42:57,969 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:42:57,969 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:42:57,969 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:42:57,969 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:42:57,970 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:42:57 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:42:56Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:42:58Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:42:57Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:42:57Z', 'request-id': 'req_01WjeLNPVW8H9xC4j5rjRHA2', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cd8154db9ab2a-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:42:57,970 - anthropic._base_client - DEBUG - request_id: req_01WjeLNPVW8H9xC4j5rjRHA2
2024-11-28 14:42:57,980 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: review --start-date 2024-11-05 --end-date 2024-11-28
2024-11-28 14:42:57,980 - wellcode_cli.commands.chat_interface - DEBUG - Parsed command_type: <enum 'CommandType'>
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - Parsed args type: <class 'list'>
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - Parsed time_range type: <class 'NoneType'>
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - command_type value: CommandType.REVIEW
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - args value: ['--start-date', '2024-11-05', '--end-date', '2024-11-28']
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - time_range value: None
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - Command context created
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - Matched REVIEW command type
2024-11-28 14:42:57,981 - wellcode_cli.commands.chat_interface - DEBUG - Executing REVIEW command
2024-11-28 14:42:57,988 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.github.com:443
2024-11-28 14:42:58,220 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:42:58,352 - urllib3.connectionpool - DEBUG - https://api.github.com:443 "GET /user/installations HTTP/11" 200 None
2024-11-28 14:42:58,358 - markdown_it.rules_block.code - DEBUG - entering code: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.fence - DEBUG - entering fence: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.blockquote - DEBUG - entering blockquote: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.hr - DEBUG - entering hr: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.list - DEBUG - entering list: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.reference - DEBUG - entering reference: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.html_block - DEBUG - entering html_block: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.heading - DEBUG - entering heading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,359 - markdown_it.rules_block.lheading - DEBUG - entering lheading: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:42:58,360 - markdown_it.rules_block.paragraph - DEBUG - entering paragraph: StateBlock(line=0,level=0,tokens=0), 0, 1, False
2024-11-28 14:43:04,277 - anthropic._base_client - DEBUG - Request options: {'method': 'post', 'url': '/v1/messages', 'timeout': 600, 'files': None, 'json_data': {'max_tokens': 1024, 'messages': [{'role': 'user', 'content': 'Convert this natural language request into a Wellcode CLI command: config'}], 'model': 'claude-3-sonnet-20240229', 'system': 'You are a CLI command interpreter for the Wellcode engineering metrics tool. Convert natural language input into specific commands.\n\nToday\'s date is 2024-11-28.\n\nAvailable Commands and Options:\n1. review\n Options:\n --start-date, -s DATE Start date for analysis (YYYY-MM-DD)\n --end-date, -e DATE End date for analysis (YYYY-MM-DD)\n --user, -u USERNAME Filter by GitHub username\n --team, -t TEAMNAME Filter by GitHub team name\n\n2. report\n Options:\n --output, -o PATH Output directory for the report\n --format, -f FORMAT Report format (html or pdf)\n\n3. config\n Interactive command to configure:\n - GitHub integration (token and organization)\n - Linear integration (API key)\n - Split.io integration (API key)\n - Anthropic integration (API key)\n\n4. chat\n Start interactive chat mode to discuss metrics\n\n5. help\n Show available commands and examples\n\n6. exit/quit\n Exit the application\n\nCommand Examples:\n- "review team performance" → "review --team frontend"\n- "show metrics for last week" → "review --start-date 2024-03-20 --end-date 2024-03-27"\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "generate report" → "report --format html"\n- "save report to desktop" → "report --output ~/Desktop --format html"\n- "setup integrations" → "config"\n- "start chat" → "chat"\n- "what can I do?" → "help"\n- "quit" → "exit"\n\nCRITICAL RULES:\n1. Team Handling:\n - Add --team flag when:\n * Input contains "team <name>" OR\n * Input contains "team" followed by a name anywhere in the sentence\n - Examples:\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check performance of team tata" → "review --team tata"\n ✅ "lets check performance of the team plop" → "review --team plop"\n - NEVER add a --team flag unless the input EXPLICITLY contains "team <name>"\n - The word "team" by itself should NEVER result in a --team flag\n \n Examples:\n ❌ "check the team performance" → "review"\n ❌ "let\'s check the team" → "review"\n ❌ "performance of the team" → "review"\n ✅ "team frontend performance" → "review --team frontend"\n ✅ "check team backend metrics" → "review --team backend"\n\n2. Use REVIEW command ONLY for direct metric queries:\n - "show metrics for user X"\n - "get last week\'s stats for team Y"\n - Simple performance data requests\n\n3. Use CHAT command for:\n - Analysis questions ("why is performance dropping?")\n - Comparative questions ("how is X doing compared to last month?")\n - Improvement suggestions ("how can team Y improve?")\n - Complex queries requiring context\n - Any questions starting with "why", "how", "what about", "any idea"\n - Performance discussions and insights\n\n4. Time-based queries:\n - "yesterday" → calculate proper date\n - "last week" → calculate 7 days ago\n - "this month" → first day of current month\n - "today" → current date\n - Always convert to YYYY-MM-DD format\n\n5. User queries:\n - "how was <user>" → review --user <user>\n - "<user>\'s performance" → review --user <user>\n\n6. Team queries:\n - "team <name>" → review --team <name>\n - "<team> performance" → review --team <name>\n\n7. Report queries:\n - "generate report" → report with default options\n - "save report to <path>" → report --output <path>\n - Specify format with "pdf" or "html" keywords\n\nImportant:\n- Output ONLY the command string with appropriate options\n- Convert relative dates to actual YYYY-MM-DD format\n- Include appropriate flags (--user, --team, --start-date, --end-date)\n- Default to "help" if the intent is unclear\n\nExample Inputs and Outputs:\n- "how was pimouss yesterday" → "review --user pimouss --start-date 2024-11-27 --end-date 2024-11-28"\n- "show team frontend metrics for last week" → "review --team frontend --start-date 2024-11-21 --end-date 2024-11-28"\n- "generate html report" → "report --format html"\n- "setup my workspace" → "config"\n- "let\'s chat about metrics" → "chat"\n- "show ymatagne\'s metrics" → "review --user ymatagne"\n- "how is ymatagne performing?" → "chat"\n- "any suggestions for ymatagne?" → "chat"\n- "what\'s causing ymatagne\'s performance drop?" → "chat"\n- "show team frontend stats" → "review --team frontend"\n- "how can frontend team improve?" → "chat"\n\nRemember: Use chat mode for analytical questions and review for direct metric queries.'}}
2024-11-28 14:43:04,278 - anthropic._base_client - DEBUG - Sending HTTP Request: POST https://api.anthropic.com/v1/messages
2024-11-28 14:43:04,278 - httpcore.connection - DEBUG - close.started
2024-11-28 14:43:04,279 - httpcore.connection - DEBUG - close.complete
2024-11-28 14:43:04,279 - httpcore.connection - DEBUG - connect_tcp.started host='api.anthropic.com' port=443 local_address=None timeout=600 socket_options=None
2024-11-28 14:43:04,288 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10d4fd950>
2024-11-28 14:43:04,288 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10d4a10a0> server_hostname='api.anthropic.com' timeout=600
2024-11-28 14:43:04,300 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10d463230>
2024-11-28 14:43:04,300 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2024-11-28 14:43:04,301 - httpcore.http11 - DEBUG - send_request_headers.complete
2024-11-28 14:43:04,301 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2024-11-28 14:43:04,301 - httpcore.http11 - DEBUG - send_request_body.complete
2024-11-28 14:43:04,301 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
2024-11-28 14:43:05,290 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 28 Nov 2024 19:43:05 GMT'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'anthropic-ratelimit-requests-limit', b'1000'), (b'anthropic-ratelimit-requests-remaining', b'999'), (b'anthropic-ratelimit-requests-reset', b'2024-11-28T19:43:04Z'), (b'anthropic-ratelimit-input-tokens-limit', b'80000'), (b'anthropic-ratelimit-input-tokens-remaining', b'80000'), (b'anthropic-ratelimit-input-tokens-reset', b'2024-11-28T19:43:05Z'), (b'anthropic-ratelimit-output-tokens-limit', b'16000'), (b'anthropic-ratelimit-output-tokens-remaining', b'16000'), (b'anthropic-ratelimit-output-tokens-reset', b'2024-11-28T19:43:05Z'), (b'anthropic-ratelimit-tokens-limit', b'96000'), (b'anthropic-ratelimit-tokens-remaining', b'96000'), (b'anthropic-ratelimit-tokens-reset', b'2024-11-28T19:43:05Z'), (b'request-id', b'req_01JCK5fntjJnH6jizP1J8NER'), (b'via', b'1.1 google'), (b'CF-Cache-Status', b'DYNAMIC'), (b'X-Robots-Tag', b'none'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8e9cd8441ed9549d-YYZ'), (b'Content-Encoding', b'gzip')])
2024-11-28 14:43:05,291 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2024-11-28 14:43:05,291 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
2024-11-28 14:43:05,291 - httpcore.http11 - DEBUG - receive_response_body.complete
2024-11-28 14:43:05,291 - httpcore.http11 - DEBUG - response_closed.started
2024-11-28 14:43:05,291 - httpcore.http11 - DEBUG - response_closed.complete
2024-11-28 14:43:05,291 - anthropic._base_client - DEBUG - HTTP Response: POST https://api.anthropic.com/v1/messages "200 OK" Headers({'date': 'Thu, 28 Nov 2024 19:43:05 GMT', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'anthropic-ratelimit-requests-limit': '1000', 'anthropic-ratelimit-requests-remaining': '999', 'anthropic-ratelimit-requests-reset': '2024-11-28T19:43:04Z', 'anthropic-ratelimit-input-tokens-limit': '80000', 'anthropic-ratelimit-input-tokens-remaining': '80000', 'anthropic-ratelimit-input-tokens-reset': '2024-11-28T19:43:05Z', 'anthropic-ratelimit-output-tokens-limit': '16000', 'anthropic-ratelimit-output-tokens-remaining': '16000', 'anthropic-ratelimit-output-tokens-reset': '2024-11-28T19:43:05Z', 'anthropic-ratelimit-tokens-limit': '96000', 'anthropic-ratelimit-tokens-remaining': '96000', 'anthropic-ratelimit-tokens-reset': '2024-11-28T19:43:05Z', 'request-id': 'req_01JCK5fntjJnH6jizP1J8NER', 'via': '1.1 google', 'cf-cache-status': 'DYNAMIC', 'x-robots-tag': 'none', 'server': 'cloudflare', 'cf-ray': '8e9cd8441ed9549d-YYZ', 'content-encoding': 'gzip'})
2024-11-28 14:43:05,292 - anthropic._base_client - DEBUG - request_id: req_01JCK5fntjJnH6jizP1J8NER
2024-11-28 14:43:05,293 - wellcode_cli.commands.chat_interface - DEBUG - Attempting to parse command: config
2024-11-28 14:43:05,293 - wellcode_cli.commands.commands - DEBUG - Starting command parsing for: config
2024-11-28 14:43:05,293 - wellcode_cli.commands.commands - DEBUG - Command string type: <class 'str'>
2024-11-28 14:43:05,293 - wellcode_cli.commands.chat_interface - ERROR - Failed to parse command - received None
2024-11-28 14:43:48,939 - httpcore.connection - DEBUG - close.started
2024-11-28 14:43:48,940 - httpcore.connection - DEBUG - close.complete