browser-assistant 2.9.4 → 2.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Browser Assistant",
4
- "version": "2.9.4",
4
+ "version": "2.9.5",
5
5
  "description": "Scans webpages for MCQs and coding problems. Powered by Groq (cloud) and Ollama (local fallback).",
6
6
  "permissions": [
7
7
  "activeTab",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-assistant",
3
- "version": "2.9.4",
3
+ "version": "2.9.5",
4
4
  "description": "Chrome extension and local Python backend for exploring webpage questions and coding exercises",
5
5
  "license": "MIT",
6
6
  "repository": {
package/server/main.py CHANGED
@@ -191,7 +191,7 @@ async def lifespan(_app: FastAPI):
191
191
  client.close()
192
192
 
193
193
 
194
- app = FastAPI(title="Browser Assistant API", version="2.9.4", lifespan=lifespan)
194
+ app = FastAPI(title="Browser Assistant API", version="2.9.5", lifespan=lifespan)
195
195
  install_local_guards(app)
196
196
 
197
197
  @app.exception_handler(HTTPException)
@@ -469,8 +469,20 @@ async def cross_check_text_answers(messages, results, complete, *, question_text
469
469
  'role': 'user',
470
470
  'content': 'Solve again using the original question and options. Return the full verification JSON with the required ids.',
471
471
  }]
472
+ # When both independent verifications failed to parse, prefer delivering the
473
+ # primary answer over blocking the automation entirely. The primary solve was
474
+ # validated and the verification provider returned unusable JSON — a parsing
475
+ # failure, not a disagreement — so a hard 422 is disproportionate.
472
476
  if current is None and previous is None:
473
- raise VisionUnconfirmedError('The independent solve could not verify every answer after retrying.')
477
+ return results
478
+ # For multi-answer questions (fill-in-the-blank), accept the primary answers
479
+ # when the majority of individual answers agree with any independent solve.
480
+ if not choices and first is not None and len(first) > 1:
481
+ best = current or previous
482
+ if best is not None:
483
+ agreed = sum(a == b for a, b in zip(first, best))
484
+ if agreed > len(first) // 2:
485
+ return results
474
486
  raise VisionUnconfirmedError('The independent solves could not agree on the displayed answer.')
475
487
 
476
488