Private
Public Access
0
0
Commit Graph

860 Commits

Author SHA1 Message Date
ed f9832b07b3 manaul correction attempts 2026-06-15 19:14:22 -04:00
ed 8c81b727d6 refactor(ai_client): remove deprecated send() function (Phase 6.1)
Removes the @deprecated send() function (was at src/ai_client.py:2939-3000)
and the from typing_extensions import deprecated import (line 38). The
function is replaced by send_result() which has been the canonical public
API since the data_oriented_error_handling_20260606 track (commit 9f86b2be).

All 3 production call sites (src/conductor_tech_lead.py:68,
src/orchestrator_pm.py:86, src/multi_agent_conductor.py:591) and 18 test
files were migrated in Phases 1-2; 4 pre-existing failures were fixed in
Phases 3-4. No remaining callers of ai_client.send(.

Verification:
- uv run rg 'def send\\(' src/ai_client.py returns 0 hits
- import src.ai_client; hasattr(ai, 'send') is False
- 73/73 migrated tests pass
2026-06-15 18:48:44 -04:00
ed bdd46299b1 refactor(multi_agent_conductor): migrate worker dispatch to send_result() (G3, public_api_migration_and_ui_polish_20260615 Phase 1.3)
Replaces deprecated ai_client.send(...) with ai_client.send_result(...) for
the 8-arg worker dispatch in run_worker_lifecycle. The new code branches on
result.ok:
  - On success: response = result.data (continue as before)
  - On error: log via comms + push a 'response' event with status='error' +
    push ticket_completed + mark ticket.status='error' + return None

This is the hardest of the 3 production migrations (5 callbacks:
pre_tool_callback, qa_callback, patch_callback, stream_callback + the
worker_comms_callback already wired up).

The 2 tests in test_phase6_engine.py + test_spawn_interception_v2.py now
fail because they mock src.ai_client.send. These will be fixed in
Phase 2.16/2.18 by mocking send_result instead. test_run_worker_lifecycle_abort
still passes because the abort check fires before the send call.
2026-06-15 16:00:05 -04:00
ed 7ea802ab80 refactor(orchestrator_pm): migrate to send_result() (G2, public_api_migration_and_ui_polish_20260615 Phase 1.2)
Replaces deprecated ai_client.send(md_content='', user_message=user_message,
enable_tools=False) with ai_client.send_result(...) and branches on
result.ok. On error, logs the ui_message() and returns [] (the function
returns a list of track definitions or [] on failure).

The 3 tests in test_orchestrator_pm.py + 1 in test_orchestrator_pm_history.py
now fail because they mock src.ai_client.send. These will be fixed in
Phase 2.14-2.15 by mocking send_result instead.
2026-06-15 15:57:00 -04:00
ed bbb3d59712 refactor(conductor_tech_lead): migrate to send_result() (G1, public_api_migration_and_ui_polish_20260615 Phase 1.1)
Replaces deprecated ai_client.send(md_content='', user_message=user_message)
with ai_client.send_result(...) and branches on result.ok. On error, logs
the ui_message() and returns None (the function returns a list of ticket
definitions or None on failure).

The previous code called the @deprecated send() shim which silently
returns '' on error. The empty string would then be passed to json.loads,
causing JSONDecodeError and 3 retry attempts. The new code short-circuits
on the first error and returns None immediately.

This is the easiest of the 3 production migrations (2-arg call with no
callbacks). See plan.md Phase 1.1. Test fixes for the production-affected
mocks in test_conductor_tech_lead.py and test_orchestration_logic.py are
in Phase 2.12 and Phase 2.13.

NOTE: 4 tests now fail (3 in test_conductor_tech_lead.py + 1 in
test_orchestration_logic.py) because they mock src.ai_client.send.
These will be fixed in Phase 2.12/2.13 by mocking send_result instead.
2026-06-15 15:53:08 -04:00
ed 4e97156e77 fix(thinking_parser): add <think> (half-width) marker support (doeh cleanup Phase 4.1) 2026-06-15 14:25:54 -04:00
ed e9abadc867 fix(ai_client): extract Gemini thought=True parts and wrap in <thinking> tags for parse_thinking_trace 2026-06-15 14:10:43 -04:00
ed 7b323e3e5f fix(app_controller): restore context_to_send definition in _api_generate (CRITICAL regression from ai_loop_regressions_20260614) 2026-06-15 12:54:11 -04:00
ed f4a782d99f fix(ai_loop): wrap MiniMax reasoning in <thinking> tags for parse_thinking_trace (FR3, Bug #3)
Adds a new wrap_reasoning_in_text: bool = False keyword argument to
run_with_tool_loop. When True and reasoning_content is non-empty, the
returned text is prepended with <thinking>...</thinking> tags so
thinking_parser.parse_thinking_trace can extract a ThinkingSegment
for the discussion entry.

The wrap is conditional (default False) so it doesn't break providers
that already wrap inline (e.g. DeepSeek, which wraps at line 2117-2118
before run_with_tool_loop sees the response).

_send_minimax now passes wrap_reasoning_in_text=bool(caps.reasoning).
When caps.reasoning is True (M2.5/M2.7), the reasoning is wrapped in
<thinking> tags. When False (M2/M2.1), the parameter is False and
no wrap happens (avoids useless getattr on non-reasoning models).

Also fixes a bug in the test_fr3_minimax_thinking_in_returned_text
test mock: it was returning a raw MagicMock instead of a Result
object, which caused the test to see auto-created MagicMock attributes
instead of the expected text. Now wraps in Result(data=MagicMock(...))
and sets ai_client._model to ensure get_capabilities('minimax', _model)
resolves to the M2.7 capabilities (reasoning=True).
2026-06-15 10:56:24 -04:00
ed 2b7b571a64 fix(ai_loop): replace dead ProviderError except clauses with send_result() pattern (FR2, Bug #1)
Replaces 3 dead 'except ai_client.ProviderError' clauses (the class was
removed in commit 64b787b8) with the new send_result() + result.ok
pattern. Removes the inner try/except block entirely (replaced by
'if not result.ok: raise HTTPException(502, ...)').

Sites fixed:
- _api_generate: send() -> send_result() + result.ok branch
- _handle_request_event (already fixed in FR1 commit 24ba2499)

AST scan via test_fr2_no_provider_error_in_source now passes: zero
remaining references to ai_client.ProviderError in src/app_controller.py.

The single remaining 'except Exception as e: import traceback;
traceback.print_exc(); raise HTTPException(500, str(e))' is the
legitimate outer except for unexpected in-flight errors.

Added a one-line comment per the plan referencing the data-oriented
error handling styleguide, so future migrations follow the same pattern.
2026-06-15 10:27:51 -04:00
ed 24ba249901 fix(ai_loop): route send_result() errors to Discussion Hub as error entries (FR1, Bug #2)
Replaces deprecated ai_client.send() in _handle_request_event with
send_result() and branches on result.ok. On error, the first ErrorInfo
is routed to the event_queue as a 'response' with status='error',
allowing _on_comms_entry to add it to the discussion history.

The previous code called the @deprecated send() shim which silently
returns '' on error. The empty string was then filtered out by
_on_comms_entry (text_content.strip() check at line 3801), so users
saw no discussion entry for failed AI requests.

This also removes the dead 'except ai_client.ProviderError' clause at
line 3692 (the class was removed in commit 64b787b8). The 2 remaining
dead clauses at lines 305, 313 are fixed in the next commit (FR2).
2026-06-15 09:22:47 -04:00
ed 74e02485a1 files & media ux improvemetn with directory folding and file name vis 2026-06-14 23:29:43 -04:00
ed ae8d01d0f7 add missing region start comment. 2026-06-14 22:43:55 -04:00
ed 2d51199699 fix(regression): for adding files in the files & media panel. 2026-06-14 22:43:42 -04:00
ed dcdcaa92f6 tiny 2026-06-13 20:50:36 -04:00
ed 5030bd848f ai client pass (in gemini region) 2026-06-13 20:49:37 -04:00
ed 1ccef1685f docs(ai_client): add detailed SQLite-granularity docstrings to secondary senders and context helpers 2026-06-13 18:27:46 -04:00
ed 20b5544d3e doc: add detailed SSDL docstrings to primary provider functions in ai_client.py 2026-06-13 18:08:04 -04:00
ed 82f21d7f55 docs(ai_client): add SQLite-granularity docstrings to tool execution functions
Also fixes return-type discrepancy in tests/test_ai_client_tool_loop.py mock by wrapping NormalizedResponse inside Result.
2026-06-13 18:05:12 -04:00
ed 752e874bf6 docs(ai_client): add detailed SQLite-granularity docstrings to send() and send_result() 2026-06-13 18:00:10 -04:00
ed 501f112591 Fix: Configure base_url dynamically for MiniMax
This resolves the 401 Unauthorized/invalid api_id error by letting the MiniMax client default to api.minimax.io/v1 (like the model listing logic) or read a custom base_url from credentials.toml.
2026-06-13 17:53:22 -04:00
ed 3aa7bdca99 Fix: Return NormalizedResponse from send_openai_compatible
This resolves the issue where calling 'send_openai_compatible' discarded the NormalizedResponse details, resulting in an AttributeError when accessing 'raw_response' inside the tool loop.
2026-06-13 17:50:43 -04:00
ed fbcc1db495 Fix: NameError when instantiating MiniMax client
Resolve name error where OpenAI was not defined in the scope of _ensure_minimax_client by calling openai.OpenAI directly.
2026-06-13 17:47:40 -04:00
ed 6caa6680bf working on ai client 2026-06-13 17:46:38 -04:00
ed 4691848683 Docstrings: SSDL + ASCII Layout Map for Personas, Providers, and Command Palette 2026-06-13 16:45:12 -04:00
ed cb129aaed9 Docstrings: SSDL + ASCII Layout Map for Preset Managers and Windows 2026-06-13 16:30:34 -04:00
ed 1136273331 finished going through the entire gui_2.py minor sift through ai client 2026-06-13 16:16:03 -04:00
ed f2fa566064 oops 2026-06-13 12:02:21 -04:00
ed 9fc2c21e82 more gui_2.py 2026-06-13 12:00:33 -04:00
ed b61a2db01d reading more code, slight adjustment to ast structual file editor ux (radio buttons going off viewport) 2026-06-13 11:08:45 -04:00
ed 394020e50c reading throuogh gui_2.py (still reading) 2026-06-13 10:27:48 -04:00
ed 26b1ec77a4 curation pass on gui_2.py 2026-06-12 23:38:31 -04:00
ed d4fbcb16d9 more diagrams (claude on agy) 2026-06-12 22:48:09 -04:00
ed aafdf3acc6 Docstrings: SSDL + ASCII Layout Map for Misc Tools and remaining MMA sub-functions 2026-06-12 22:38:38 -04:00
ed dd1fe466cb Docstrings: SSDL + ASCII Layout Map for all Operations Monitor region functions 2026-06-12 22:35:36 -04:00
ed f6e4df0cf6 Docstrings: SSDL + ASCII Layout Map for all Discussions region functions 2026-06-12 22:33:03 -04:00
ed 6e59782d2b Docstrings: remove State Mutations section, add ASCII Layout Maps to Context Management and MMA groups 2026-06-12 22:30:19 -04:00
ed 443f02a744 more ascii (gemini ran out already...)v 2026-06-12 22:26:07 -04:00
ed fc2171a40f Add SSDL-style docstrings to MMA Orchestrator Panel group functions 2026-06-12 22:18:59 -04:00
ed e376cc99a8 Add SSDL-style docstrings to Core Interaction Loop panels (comms history, message input, response stream, tool calls, and script approval) 2026-06-12 22:16:06 -04:00
ed 1feb9102f4 Add SSDL-style docstrings to base prompt diff modal, add context files modal, save workspace profile modal, context modals, and context preview window 2026-06-12 22:10:40 -04:00
ed 00099bceaa remove old call tracking comments. 2026-06-12 22:09:49 -04:00
ed 42af7db7f9 Add SSDL-style docstrings to preset manager and persona editor functions, and fix embedded call delegation bug 2026-06-12 22:01:36 -04:00
ed c3edbd9543 Add SSDL-style docstrings to context helper widgets (files and media, batch actions, presets, screenshots, snapshot tab) 2026-06-12 21:55:20 -04:00
ed 06b6d4794f Add SSDL-style docstrings to History and Telemetry functions and fix missing rendering/profiling in session insights panel 2026-06-12 21:54:16 -04:00
ed 924d720c76 Add SSDL-style docstrings to cache, usage, tool analytics, token budget, and log management panels 2026-06-12 21:52:48 -04:00
ed eefada9a3d Add SSDL-style docstrings to RAG, System Prompts, Provider, and Persona selector panels 2026-06-12 21:52:21 -04:00
ed 6f33d57750 Fix render_paths_panel scoping bug and nest render_path_field 2026-06-12 21:51:42 -04:00
ed b521b4523c Refactor docstrings to resolve DAG Context with SSDL shape and remove Threading sections
Keeps the ASCII layout map previews, baseline summaries, and state mutation blocks, while cleanly removing Threading & Safety sections and replacing DAG references with SSDL Shape notations.
2026-06-12 21:47:21 -04:00
ed 56e1950b4b Document settings hubs and diagnostics in gui_2.py and complete track
Add SQLite-style inline docstrings to render_ai_settings_hub, render_agent_tools_panel, and render_diagnostics_panel under simplified granularity per user request. Mark track sqlite_docs_gui_2_20260612 as complete.
2026-06-12 21:30:47 -04:00