Skip to content

refactor(agent): migrate Console chat and audio runtime - #46582

Merged
hjlarry merged 4 commits into
mainfrom
hjlarry/agent-console-runtime-refactor
Nov 26, 2026
Merged

hjlarry merged 4 commits into
mainfrom
hjlarry/agent-console-runtime-refactor

Conversation

@hjlarry

@hjlarry hjlarry commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #39993. This follows the Config Inspector migration in #46561, now merged into main.

  • Route Console Agent chat, Build finalization, and task stop through injected runtime and access services. Preserve account-scoped Build and Preview conversation selection and the existing generation engine.
  • Route Agent transcription, text-to-speech, and voice discovery through the shared app audio runtime. The Agent App repository reuses existing draft queries, revalidates the admitted App, and resolves owned message audio before releasing the database session.

Screenshots

Checklist

  • Added regression coverage for conversation ownership, Agent draft and message isolation, and audio session lifetime.

@github-actions github-actions Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 17, 2026
@hjlarry
hjlarry added this pull request to stack #46094 November 17, 2026 09:23
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-11-26 09:52:28.624584473 +0000
+++ /tmp/pyrefly_pr.txt	2026-11-26 09:52:10.007527972 +0000
@@ -4912,27 +4912,27 @@
 ERROR `object` is not assignable to dict key `agent_binding` with type `str` [bad-assignment]
    --> tests/unit_tests/services/agent/test_dsl_service.py:131:33
 ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `AgentIconType | SQLCoreOperations[AgentIconType | None] | None` in function `models.agent.Agent.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1145:19
+    --> tests/unit_tests/services/agent/test_roster_service.py:1086:19
 ERROR Argument `Literal['emoji']` is not assignable to parameter `icon_type` with type `AgentIconType | SQLCoreOperations[AgentIconType | None] | None` in function `models.agent.Agent.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1294:19
+    --> tests/unit_tests/services/agent/test_roster_service.py:1235:19
 ERROR Object of class `object` has no attribute `prompt` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1714:12
+    --> tests/unit_tests/services/agent/test_roster_service.py:1655:12
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1905:12
+    --> tests/unit_tests/services/agent/test_roster_service.py:1846:12
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1906:12
+    --> tests/unit_tests/services/agent/test_roster_service.py:1847:12
 ERROR Cannot index into `object` [bad-index]
-    --> tests/unit_tests/services/agent/test_roster_service.py:1907:12
+    --> tests/unit_tests/services/agent/test_roster_service.py:1848:12
 ERROR Argument `list[str | None]` is not assignable to parameter `version_ids` with type `list[str]` in function `services.agent.roster_service.AgentRosterService._load_versions_by_id` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:2986:52
+    --> tests/unit_tests/services/agent/test_roster_service.py:2927:52
 ERROR Argument `Literal[0]` is not assignable to parameter `message_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:3145:36
+    --> tests/unit_tests/services/agent/test_roster_service.py:3086:36
 ERROR Argument `Literal[0]` is not assignable to parameter `answer_unit_price` with type `Decimal | SQLCoreOperations[Decimal]` in function `models.model.Message.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:3147:35
+    --> tests/unit_tests/services/agent/test_roster_service.py:3088:35
 ERROR Argument `Literal[0]` is not assignable to parameter `total_price` with type `Decimal | SQLCoreOperations[Decimal | None] | None` in function `models.model.Message.__init__` [bad-argument-type]
-    --> tests/unit_tests/services/agent/test_roster_service.py:3148:29
+    --> tests/unit_tests/services/agent/test_roster_service.py:3089:29
 ERROR Object of class `NoneType` has no attribute `conversation_id` [missing-attribute]
-    --> tests/unit_tests/services/agent/test_roster_service.py:3793:16
+    --> tests/unit_tests/services/agent/test_roster_service.py:3734:16
 ERROR Class member `StubResolver.resolve` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
    --> tests/unit_tests/services/data_migration/test_import_service.py:256:13
 ERROR Class member `CapturingImportService._import_workflows` overrides parent class `MigrationImportService` in an inconsistent manner [bad-override]

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 87.91% 87.92% +0.01%
Strict coverage 87.57% 87.58% +0.01%
Typed symbols 97,208 97,241 +33
Untyped symbols 13,423 13,415 -8
Modules 4673 4672 -1

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.64548% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.52%. Comparing base (f6c206b) to head (2bba25f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
api/controllers/console/app/completion.py 90.14% 4 Missing and 3 partials ⚠️
api/repositories/app/agent_app_repository.py 88.23% 6 Missing ⚠️
api/controllers/console/app/audio.py 96.82% 2 Missing ⚠️
api/services/agent/console_runtime.py 95.23% 1 Missing and 1 partial ⚠️
api/services/app_audio_adapters.py 92.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46582      +/-   ##
==========================================
- Coverage   90.53%   90.52%   -0.01%     
==========================================
  Files        6608     6608              
  Lines      410553   410694     +141     
  Branches    82377    82393      +16     
==========================================
+ Hits       371675   371796     +121     
- Misses      32488    32499      +11     
- Partials     6390     6399       +9     
Flag Coverage Δ
api 90.21% <92.97%> (-0.01%) ⬇️
cli 94.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from hjlarry/agent-config-inspector-refactor to main November 26, 2026 09:08
@github-actions github-actions Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Nov 26, 2026
@hjlarry
hjlarry force-pushed the hjlarry/agent-console-runtime-refactor branch from da893e8 to 49cb874 Compare November 26, 2026 09:15
@hjlarry
hjlarry marked this pull request as ready for review November 26, 2026 09:30
@hjlarry
hjlarry added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@hjlarry
hjlarry added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit a66dd8a Nov 26, 2026
66 checks passed
@hjlarry
hjlarry deleted the hjlarry/agent-console-runtime-refactor branch November 26, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants