Commit Graph

4347 Commits

Author SHA1 Message Date
Saurav Panda 8dc0f17491 increased loop detection window 2026-02-10 13:09:32 -08:00
Chase Xu 993a4c1f5b fix: remove double-counting of reasoning_tokens in OpenAI usage
OpenAI's completion_tokens already includes reasoning_tokens as a subset,
so adding them again was incorrectly inflating token counts by ~2x for
all reasoning models (o1, o3, o4-mini, etc.).

This aligns with other OpenAI-compatible providers (OpenRouter, Vercel,
Cerebras, Groq) which use completion_tokens directly.

Note: This is different from Google Gemini where thinking_tokens ARE
reported separately and need to be added.

Fixes #4065
2026-02-10 05:32:13 -06:00
Saurav Panda 07817c2c5b Fixed structured output issue with simple judge 2026-02-09 17:09:35 -08:00
laithrw f3ed2acb11 Merge branch 'main' into fix/sensitive-data-placeholder-instructions 2026-02-09 14:40:45 -05:00
laithrw 7f3e26bef0 Merge branch 'main' into fix/sensitive-data-placeholder-instructions 2026-02-09 14:30:09 -05:00
laithrw f469617aa7 Merge branch 'main' into fix/issue-3970-browser-behavior 2026-02-09 14:28:52 -05:00
laithrw 9131c88f98 Merge branch 'main' into 3615 2026-02-08 17:34:07 -05:00
Laith Weinberger e1e170a5fd fix agent not stopping: consecutive_failures counter was resetting on multi-action error steps 2026-02-08 17:25:39 -05:00
Laith Weinberger 53c1b0dfb9 Merge origin/issue-2748 into HEAD 2026-02-08 16:37:44 -05:00
Laith Weinberger 1737c5bea4 lint 2026-02-08 16:36:45 -05:00
laithrw 1724d314de Merge branch 'main' into issue-2748 2026-02-08 16:30:56 -05:00
Laith Weinberger 4d05218d7d fix: redirect logging to stderr so MCP stdio doesn't break (#2748) 2026-02-08 16:29:05 -05:00
Laith Weinberger 1629799dd3 fix(openai): structured output call shouldn't depend on schema injection
Fix indentation so structured-output request executes even when add_schema_to_system_prompt is false; add regression tests for choices=null in both structured and non-structured paths.
2026-02-08 16:03:21 -05:00
laithrw d15f0a32c7 Merge branch 'main' into fix/3897-llm-response-parsing 2026-02-08 15:43:05 -05:00
Laith Weinberger 62d19f0c9a fix(openai): handle proxy responses with missing/null choices; undo test change
Avoid indexing response.choices[0] when proxies return choices=null/empty; raise a clear ModelProviderError (with base_url hint) and use the validated first choice for content/finish_reason
2026-02-08 15:37:59 -05:00
laithrw 880b636422 Merge branch 'main' into 3895 2026-02-08 11:15:44 -05:00
Laith Weinberger 9e95241bbb stop agent if browser closed 2026-02-08 11:14:49 -05:00
ashish-cheruku ab83ee7a8a fix: improve sensitive_data placeholder instructions for LLM clarity
Fixes #3970

The LLM was typing literal placeholder names (e.g., 'user_name') instead
of wrapping them in <secret> tags (e.g., '<secret>user_name</secret>').

Changes to _get_sensitive_data_description():
- Added clear 'SENSITIVE DATA' header to draw attention
- Changed placeholder list format from Python list to bullet points
- Added explicit 'MUST' instruction emphasizing the required format
- Added concrete example using the first actual placeholder name
- Added explanation that the system will replace tags with actual values

This makes it much clearer to the LLM that it needs to wrap placeholder
names in <secret> tags for the automatic replacement mechanism to work.
2026-02-06 18:10:14 +05:30
laithrw d86be39eeb Merge branch 'main' into fix/structured-output-schema-collision 2026-02-05 23:44:03 -05:00
Saurav Panda d1c9a38c00 Merge branch 'main' into message-compaction 2026-02-05 20:29:03 -08:00
Saurav Panda 6b9910a546 changed the threshold for compaction 2026-02-05 16:41:08 -08:00
Laith Weinberger 04da1fd30c strip success from JSON schema so invisible to the LLM, avoiding confusion 2026-02-05 16:49:36 -05:00
Saurav Panda 79501fe2cd added message compaction for agent 2026-02-05 12:26:11 -08:00
Saurav Panda 3c57cdc756 Merge branch 'main' into update-action-loop-prompt 2026-02-05 12:08:33 -08:00
Saurav Panda 995cb0176b updated default max step to 500 2026-02-05 11:20:47 -08:00
Saurav Panda bb5914f251 added milder nudge for action loop 2026-02-05 11:17:20 -08:00
laithrw 99be7b1b48 Merge branch 'main' into fix/no-tab-switch 2026-02-04 21:24:34 -05:00
laithrw 9d81f64b2e Merge branch 'main' into kalil0321/har_watchdog 2026-02-04 21:17:10 -05:00
Laith Weinberger 7455b3c1af deduplicate code; allow CDP events to propagate; error handling 2026-02-04 21:14:14 -05:00
Laith Weinberger d66181cdc6 notify agent if new tab opened 2026-02-04 21:02:13 -05:00
Saurav Panda 332694bf1a Added date info to simple judge 2026-02-04 17:04:39 -08:00
Saurav Panda cec4aea3bc increased threshold for loop detection 2026-02-04 16:34:42 -08:00
Saurav Panda d24dea0aa4 Merge branch 'main' into improve-input-field-handling 2026-02-03 18:22:19 -08:00
Saurav Panda 5d7ff041d3 improved concatenation heuristic 2026-02-03 18:02:58 -08:00
Saurav Panda bbf3cc0164 Merge branch 'main' into action-detection-loop 2026-02-03 17:18:06 -08:00
Saurav Panda b96b9436fc fixed agent loop detection 2026-02-03 16:00:08 -08:00
Saurav Panda bd4ead5d2e Action Loop detection 2026-02-03 15:19:59 -08:00
Laith Weinberger f9c36f11a4 lint 2026-02-03 17:59:24 -05:00
laithrw bcb5a2ad63 Merge branch 'main' into feat/smart-pdf-reading 2026-02-03 17:44:37 -05:00
Laith Weinberger 799e714c2b mitigate injection; don't drop overbudget pages
- restricted read_long_content file access to only paths in available_file_paths or browser_session.download_files to mitigate injection
- made PDF page selection truncate pages that exceed char budget instead of dropping them entirely
- fixed truncation hint in file_system.py to reference read_long_context instead of search_page
2026-02-03 17:42:02 -05:00
laithrw a511ba2f1e Merge branch 'main' into 3619 2026-02-03 17:32:46 -05:00
Saurav Panda 2a5768f3da fixed pyright issues 2026-02-03 13:02:03 -08:00
Saurav Panda 749fa56d1a improve text field handling 2026-02-03 12:52:56 -08:00
Laith Weinberger 38fb5b12df Merge remote-tracking branch 'origin/main' into feat/smart-pdf-reading 2026-02-03 14:15:49 -05:00
Saurav Panda da5b4237ba fixed lint issue 2026-02-02 23:01:52 -08:00
Saurav Panda 0dba38ed95 Merge branch 'main' into align-agent-success-with-judge 2026-02-02 22:16:11 -08:00
Saurav Panda 8565c7d267 updated agent success with simple judge 2026-02-02 22:14:45 -08:00
Saurav Panda 65405d8a79 Merge branch 'main' into align-agent-success-with-judge 2026-02-02 21:50:02 -08:00
Saurav Panda bce72138c4 fixed lint issue 2026-02-02 21:49:48 -08:00
Saurav Panda 4d5976c427 Merge branch 'main' into improve-agent-planning 2026-02-02 21:45:06 -08:00