Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
366 commits
Select commit Hold shift + click to select a range
329a034
merge(platform): merge latest dev into feat/subscription-tier-billing
majdyz Apr 11, 2026
9583445
merge(frontend/builder): resolve conflicts from PR #12726 dev merge
majdyz Apr 11, 2026
5bb7027
fix(platform): address remaining PR review comments on subscription b…
majdyz Apr 11, 2026
2057b45
test(frontend): add Vitest+RTL integration tests for SubscriptionTier…
majdyz Apr 11, 2026
7f6163b
fix(platform): address final PR review comments on subscription billing
majdyz Apr 11, 2026
e79214f
refactor(frontend/builder): remove useMemo violations + add increment…
majdyz Apr 11, 2026
d81bbdb
fix(backend): avoid caching Stripe error fallback in _get_stripe_pric…
majdyz Apr 11, 2026
ce57601
fix(frontend): fix TypeScript errors in SubscriptionTierSection and i…
majdyz Apr 11, 2026
1935137
fix(frontend): memoize DefaultChatTransport to prevent mid-stream resets
majdyz Apr 11, 2026
6f7bf90
fix(backend): harden URL validator and add adversarial redirect tests
majdyz Apr 11, 2026
2a6b65f
fix(executor): notify low balance after extra-iteration charges
majdyz Apr 11, 2026
693c616
fix(util/cache): properly distinguish missing entries from cached None
majdyz Apr 11, 2026
83fc444
fix(frontend/builder): re-add navigation race guard for parsedActions
majdyz Apr 11, 2026
47852cf
fix(frontend/builder): add navigation race guard to tool-call detecti…
majdyz Apr 11, 2026
72660f8
test(orchestrator): use AsyncMock for charge_node_usage in remaining …
majdyz Apr 11, 2026
8b93cea
fix(platform): harden Stripe billing flow against race + replay edges
majdyz Apr 11, 2026
2f24091
fix(platform): simplify stripe customer race protection
majdyz Apr 11, 2026
d49ffac
fix(backend/copilot): flush buffered rounds before mid-loop pending d…
majdyz Apr 11, 2026
c70e34c
fix(backend/copilot): prevent duplicate assistant text after mid-loop…
majdyz Apr 11, 2026
db9eb29
fix(backend): address review findings for pending-message endpoint
majdyz Apr 12, 2026
5e8d3ba
fix(backend/executor): harden orchestrator tool execution error handling
majdyz Apr 12, 2026
0251bfd
fix(backend): fix inverted still_has_active_sub predicate and add has…
majdyz Apr 12, 2026
a4006fa
fix(backend): scope URL @ check to netloc only in checkout redirect v…
majdyz Apr 12, 2026
69e0a66
fix(frontend): wrap async confirmDowngrade in void to avoid floating …
majdyz Apr 12, 2026
6bad358
fix(frontend/builder): address review comments on useBuilderChatPanel
majdyz Apr 12, 2026
7b783aa
fix(backend): use PendingMessageContext type in QueuePendingMessageRe…
majdyz Apr 12, 2026
5d7fa7c
fix(backend): update test to use PendingMessageContext attribute access
majdyz Apr 12, 2026
44aa676
fix(frontend): update stale assertion in applyConnectNodes duplicate-…
majdyz Apr 12, 2026
f3f598d
Wrap mid-loop drain_pending_messages in try/except
majdyz Apr 12, 2026
b622886
Add None guard for tool_node_stats after on_node_execution
majdyz Apr 12, 2026
057412e
fix(copilot): allow exactly 30 pending calls per window
majdyz Apr 12, 2026
bf7f674
fix(frontend): void floating promise in handleTierChange
majdyz Apr 12, 2026
ed65756
fix(frontend): reset isCreatingSession in retrySession and cap parsed…
majdyz Apr 12, 2026
48f022b
fix(subscription): type SubscriptionStatusResponse.tier as Literal, a…
majdyz Apr 13, 2026
10980f3
fix(copilot): wrap SDK turn-start drain in try/except, deduplicate fo…
majdyz Apr 13, 2026
3b7e678
fix(frontend/builder): address round-5 review comments on BuilderChat…
majdyz Apr 13, 2026
626fe17
fix(orchestrator): resolve None future on swallowed errors; add missi…
majdyz Apr 13, 2026
77ed619
fix(frontend/builder): add flowID to tool-call effect deps for correc…
majdyz Apr 13, 2026
64c3ef4
chore: apply Prettier formatting to BuilderChatPanel files
majdyz Apr 13, 2026
e901b64
fix(test): fix _handle_low_balance mock signature to accept positiona…
majdyz Apr 13, 2026
45f96d5
fix(copilot): wrap baseline turn-start drain in try/except; add 404/4…
majdyz Apr 13, 2026
52d8e67
fix(subscription): add enum to SubscriptionStatusResponse.tier in ope…
majdyz Apr 13, 2026
8a2dd8f
fix(frontend): apply Prettier formatting to openapi.json after enum a…
majdyz Apr 13, 2026
a3b0cea
fix(frontend/builder): route text parts through MessagePartRenderer
majdyz Apr 13, 2026
557ff84
style(backend): apply Black formatting to credit.py set-difference ex…
majdyz Apr 13, 2026
929c8a3
fix(platform): move stale-sub cleanup after idempotency check in sync…
majdyz Apr 13, 2026
5ff46ff
fix(backend): address review feedback on orchestrator billing
majdyz Apr 13, 2026
e558c60
fix(orchestrator): don't propagate non-billing charge errors as tool …
majdyz Apr 13, 2026
6ccb44e
fix(copilot): add 404/429 to route decorator, reformat routes.py, reg…
majdyz Apr 13, 2026
cbf309c
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 13, 2026
ca0c95b
fix(frontend): add SUBSCRIPTION to CreditTransactionType enum in open…
majdyz Apr 13, 2026
248a415
chore: more improvements
0ubbe Apr 13, 2026
5478217
Merge 'dev' into 'feat/agent-intelligence-layer'
0ubbe Apr 13, 2026
76a8c5d
feat(platform): agent intelligence layer UI polish and execution counts
0ubbe Apr 13, 2026
0d97cf1
fix(frontend): UI polish - icon placement, menu cleanup, revert run m…
0ubbe Apr 13, 2026
ae01433
fix(frontend): resolve lint errors and type issues
0ubbe Apr 13, 2026
efa8028
fix(frontend): address PR review comments
0ubbe Apr 13, 2026
2a59b26
fix(backend): mock _fetch_execution_counts in test_get_library_agents
0ubbe Apr 13, 2026
fdb40dd
fix(frontend): pass params arg to useGetV2GetSession
0ubbe Apr 13, 2026
845c04d
fix(frontend): update library integration tests for renamed UI elements
0ubbe Apr 13, 2026
44cfd0d
Merge remote-tracking branch 'origin/dev' into feat/copilot-pending-m…
majdyz Apr 13, 2026
62a6175
fix(frontend): clear ?subscription=success URL param after showing toast
majdyz Apr 13, 2026
72ed9b2
fix(backend): address review comments on pending-messages buffer
majdyz Apr 13, 2026
2bd4671
Merge remote-tracking branch 'origin/feat/copilot-pending-messages' i…
majdyz Apr 13, 2026
0cf1a5a
fix(backend/executor): address round 5 review comments
majdyz Apr 13, 2026
99339fb
fix(backend/executor): resolve merge conflicts + fix _NoOpBlock UUID
majdyz Apr 13, 2026
ba8513d
fix(copilot): abort SSE stream and disconnect backend listeners on se…
0ubbe Apr 13, 2026
d462f42
fix(backend/copilot): address review comments on pending messages
majdyz Apr 13, 2026
eaa8335
fix(backend): harden sync_subscription_from_stripe and add partial-ca…
majdyz Apr 13, 2026
46434e7
fix(frontend): add skeleton loader on isLoading and document useEffec…
majdyz Apr 13, 2026
9b38e7b
fix(backend/executor): address round 6 review comments
majdyz Apr 13, 2026
ed6a623
fix(frontend/builder): add type=button to toggle and cap seed prompt …
majdyz Apr 13, 2026
bfe67b6
test: add missing-customer test for sync_subscription_from_stripe and…
majdyz Apr 13, 2026
4bd79d8
fix(frontend): remove unused variable in skeleton loading test
majdyz Apr 13, 2026
bb52c5b
fix(platform): cleanup cancelled URL param, parallelize stripe calls,…
majdyz Apr 13, 2026
bbc0d7a
fix(frontend/builder): add backend max_length validation, rename BYTE…
majdyz Apr 13, 2026
234a0f8
fix(frontend/builder): update openapi.json to reflect StreamChatReque…
majdyz Apr 13, 2026
09a601b
fix(frontend/builder): increase StreamChatRequest.message limit from …
majdyz Apr 14, 2026
3dc4a94
fix(frontend/builder): increase StreamChatRequest.message limit to 64…
majdyz Apr 14, 2026
e3b8b86
fix(backend): address coderabbitai review comments on pending messages
majdyz Apr 14, 2026
a414c6e
fix(backend/executor): log InsufficientBalanceError before re-raise i…
majdyz Apr 14, 2026
c1be19d
fix(frontend): reset full session state on user switch in useBuilderC…
majdyz Apr 14, 2026
49b8e51
fix(frontend): enable chat input during streaming for message queuing
majdyz Apr 14, 2026
90b65bc
fix(frontend/builder): sync openapi.json maxLength to 64000 and fix P…
majdyz Apr 14, 2026
c677d9d
fix(backend/copilot): insert pending messages before current user msg…
majdyz Apr 14, 2026
fc03679
fix(backend/copilot): fix test message limit and sync openapi.json sc…
majdyz Apr 14, 2026
052518c
fix(frontend/builder): set skip guards before reset on userId change
majdyz Apr 14, 2026
1076637
fix(copilot): block file attachment queue during streaming; fix injec…
majdyz Apr 14, 2026
be8d54b
fix(platform): address reviewer should-fix items for subscription bil…
majdyz Apr 14, 2026
14e1b47
test(backend): clear price_id cache between direct get_subscription_p…
majdyz Apr 14, 2026
0abf490
test(backend/executor): cover on_node_execution returns None path
majdyz Apr 14, 2026
ec65fd5
fix(backend): add cache_none=False to get_subscription_price_id
majdyz Apr 14, 2026
810cdf1
fix(frontend/builder): resolve merge conflicts with dev
majdyz Apr 14, 2026
64fc7bd
fix(backend/copilot): resolve merge conflicts with dev
majdyz Apr 14, 2026
c83dac8
fix: resolve merge conflicts with dev
majdyz Apr 14, 2026
5537dcc
fix: resolve merge conflicts with dev
majdyz Apr 14, 2026
f53098d
fix(backend/copilot): fix forward scan in inject_user_context targeti…
majdyz Apr 14, 2026
7d47fa1
Merge remote-tracking branch 'origin/dev' into feat/agent-intelligenc…
0ubbe Apr 14, 2026
38cdefa
fix(frontend): address PR review comments for Agent Intelligence Layer
0ubbe Apr 14, 2026
ef7d75c
fix(frontend): fix ChatInput mode toggle test to match Radix Tooltip …
0ubbe Apr 14, 2026
187d6df
fix(backend): skip success_rate calculation when executions not loaded
0ubbe Apr 14, 2026
e1d2583
fix: revert out-of-scope .dockerignore change
0ubbe Apr 14, 2026
267f09e
fix(frontend/copilot): sync PulseChips agent source with Library page
0ubbe Apr 14, 2026
3efa7b5
fix(frontend/builder): remove proactive auto-send, inject graph conte…
majdyz Apr 14, 2026
38f2c87
fix(frontend/builder): fix failing CI tests after removing auto-send …
majdyz Apr 14, 2026
f25de5e
refactor(frontend): use AgentExecutionStatus enum instead of hardcode…
0ubbe Apr 14, 2026
01f5c98
Merge branch 'dev' into feat/subscription-tier-billing
majdyz Apr 14, 2026
b41a918
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fe…
majdyz Apr 14, 2026
c32fa8b
Merge remote-tracking branch 'origin/dev' into fix/copilot-stream-dis…
0ubbe Apr 14, 2026
dda59aa
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fi…
majdyz Apr 14, 2026
dae279f
fix(backend/copilot): resolve merge conflicts with dev
majdyz Apr 14, 2026
cf89b58
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fe…
majdyz Apr 14, 2026
5753b19
Merge remote-tracking branch 'origin/feat/subscription-tier-billing' …
majdyz Apr 14, 2026
6e4dec6
fix(frontend/builder): restore seed prompt truncation removed in refa…
majdyz Apr 14, 2026
1f3ebaf
fix(copilot): address PR review — gate session-switch abort, restore …
0ubbe Apr 14, 2026
27a7f95
fix(frontend/copilot): show enqueue button when typing, fix queuing, …
majdyz Apr 14, 2026
64242ef
fix(platform): block self-service paid upgrades when payment flag is …
majdyz Apr 14, 2026
8fd57ac
fix(copilot): reset user-stopping flag after session-switch microtask…
0ubbe Apr 14, 2026
e42f228
Merge branch 'dev' into fix/copilot-stream-disconnect-on-session-switch
0ubbe Apr 14, 2026
1d95a54
Merge remote-tracking branch 'origin/dev' into feat/agent-intelligenc…
0ubbe Apr 14, 2026
dc37c97
Merge branch 'dev' into feat/subscription-tier-billing
majdyz Apr 14, 2026
b3e7745
fix(frontend/library): use aliased fetching flag for favorites pagina…
0ubbe Apr 14, 2026
737ca78
Merge branch 'dev' into feat/agent-intelligence-layer
0ubbe Apr 14, 2026
f4f8699
fix(backend): fix Stripe price ID LD flag lookup and subscription pay…
majdyz Apr 14, 2026
74f3e01
fix(platform/copilot): fix queued message UX — remove toast, persist …
majdyz Apr 14, 2026
d6cc701
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fe…
majdyz Apr 14, 2026
40684a1
fix(platform/copilot): sync openapi.json with export-api-schema output
majdyz Apr 14, 2026
ecae8fd
Merge branch 'dev' into fix/copilot-stream-disconnect-on-session-switch
0ubbe Apr 14, 2026
7a7841c
fix(frontend/library): remove misleading allAgents alias and dead bri…
0ubbe Apr 14, 2026
68d0d85
test(backend): add tests for GET pending messages peek endpoint
majdyz Apr 14, 2026
310706f
fix(frontend/copilot): pass isStreaming prop to ModeToggleButton
0ubbe Apr 14, 2026
0964566
Merge branch 'dev' into feat/agent-intelligence-layer
0ubbe Apr 14, 2026
01e6dc5
test(backend/copilot): add tests for disconnect_all_listeners to lift…
0ubbe Apr 14, 2026
db45cad
Merge remote-tracking branch 'origin/dev' into fix/copilot-stream-dis…
0ubbe Apr 14, 2026
df916c7
fix(backend): cancel Stripe subscription at period end on downgrade
majdyz Apr 14, 2026
43f1019
fix(backend): don't cancel Stripe sub when balance covers failed payment
majdyz Apr 14, 2026
f394d3b
feat(platform): proration credit notice on upgrade + cancel-at-period…
majdyz Apr 14, 2026
c90ee41
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fe…
majdyz Apr 14, 2026
8cfb26a
fix(frontend): sync openapi.json with proration_credit_cents and fix …
majdyz Apr 14, 2026
9a4c4fb
fix(backend): update DB tier immediately when no Stripe subscription …
majdyz Apr 14, 2026
da17c0e
fix(backend): fix cancel_stripe_subscription tests to mock modify ins…
majdyz Apr 14, 2026
2766c0d
fix(frontend/copilot): add aria-label to queue button and keep stop v…
majdyz Apr 14, 2026
31318e5
fix(backend): pay Stripe invoice after balance covers subscription pa…
majdyz Apr 14, 2026
e9ff608
fix(backend): add invoice_id idempotency key for subscription payment…
majdyz Apr 14, 2026
a0d8e0c
fix(backend/copilot): auto-continue pending messages after turn ends
majdyz Apr 14, 2026
7748953
fix(backend): use stripe.Subscription.modify for paid→paid tier chang…
majdyz Apr 14, 2026
175c121
fix(backend): format credit_subscription_test.py with black
majdyz Apr 14, 2026
5b8aeff
fix(frontend): show human-readable tier label in downgrade confirmati…
majdyz Apr 15, 2026
80a8a6b
fix(frontend/copilot): support multiple queued messages and clear ind…
majdyz Apr 15, 2026
b20c6a3
Merge remote-tracking branch 'origin/dev' into feat/copilot-pending-m…
majdyz Apr 15, 2026
0b211c6
fix(frontend/copilot): await onEnqueue before clearing input; add pee…
majdyz Apr 15, 2026
972d641
merge(dev): resolve ChatContainer conflict — keep isStreaming/isInput…
majdyz Apr 15, 2026
823321c
fix(frontend/copilot): rethrow enqueue error so input is preserved on…
majdyz Apr 15, 2026
055cd93
test(frontend/copilot): add queue button and dry-run toggle coverage …
majdyz Apr 15, 2026
34446dd
fix(backend/copilot): fix SDK pending-message ordering at turn start
majdyz Apr 15, 2026
bdad672
style(backend/copilot): run black formatter on sdk/service.py
majdyz Apr 15, 2026
8ea16cb
test(frontend/copilot): add ChatMessagesContainer coverage for queued…
majdyz Apr 15, 2026
3b26696
ci: mark platform-frontend patch coverage as informational
majdyz Apr 15, 2026
64fee6b
refactor(backend): replace raw SQL execution count with get_graph_exe…
majdyz Apr 15, 2026
9235990
refactor(backend/copilot): extract shared pending-message helpers, si…
majdyz Apr 15, 2026
4ac231c
fix(backend/copilot): only count tasks as cancelled when CancelledErr…
majdyz Apr 15, 2026
14d3344
fix(frontend): update streaming test + fix EditNameDialog race condition
majdyz Apr 15, 2026
a15cfc0
refactor(backend): replace N+1 execution counts with Prisma group_by
majdyz Apr 15, 2026
0a95368
refactor(backend/copilot): extract call-rate-limit to helpers, drop r…
majdyz Apr 15, 2026
55af06f
test(backend): add unit tests for _fetch_execution_counts to cover patch
majdyz Apr 15, 2026
47b7423
fix(backend/copilot): fix broken tests after pending-message refactor
majdyz Apr 15, 2026
ec0072e
test(backend/copilot): add unit tests for pending_message_helpers
majdyz Apr 15, 2026
32d3c91
test(backend): add coverage for list_favorite_library_agents and erro…
majdyz Apr 15, 2026
4059c29
style: format pending_message_helpers_test
majdyz Apr 15, 2026
237a5bb
test(backend): cover execution_count_override and success_rate branch…
majdyz Apr 15, 2026
a28d643
fix(copilot): fix retry_scenarios_test mock target after drain refactor
majdyz Apr 15, 2026
bb1c308
feat(backend/copilot): add LaunchDarkly per-user model targeting flag
majdyz Apr 15, 2026
e2554a6
fix(backend/copilot): rename _env_flag_override_string to public, add…
majdyz Apr 15, 2026
8716905
fix(copilot): resolve merge conflict with dev in sdk/service.py
majdyz Apr 15, 2026
d356872
refactor(backend/executor): extract billing module, rename extra_runt…
majdyz Apr 15, 2026
b161d95
fix(backend/executor): fix lint — remove unused imports, fix E402, up…
majdyz Apr 15, 2026
2a6c21c
fix(backend/executor): add cap warning log, rename metadata key to ex…
majdyz Apr 15, 2026
e6515b8
fix(backend/executor): fix lint format and type error in test (_charg…
majdyz Apr 15, 2026
a5e4a8e
feat(copilot): standard/advanced model toggle with Opus rate-limit mu…
majdyz Apr 15, 2026
dd2833d
Merge branch 'dev' into feat/copilot-model-targeting-flag
majdyz Apr 15, 2026
491481c
fix(backend/executor): remove extra blank line in manager.py (ruff fo…
majdyz Apr 15, 2026
739d5ce
fix(copilot): rename store state, inline multiplier, fix cost-log mod…
majdyz Apr 15, 2026
a462396
Merge branch 'feat/copilot-model-targeting-flag' of github.com:Signif…
majdyz Apr 15, 2026
b536c9c
feat(backend/copilot): add for_agent_generation flag to find_block
majdyz Apr 15, 2026
3cdaee9
fix(backend/copilot): backend idempotency guard + frontend dedup fix …
majdyz Apr 15, 2026
8e0ae5a
fix(backend/executor): make try_send_insufficient_funds_notif public,…
majdyz Apr 15, 2026
2f8d9cc
fix(copilot): update ChatInput and store tests for renamed copilotCha…
majdyz Apr 15, 2026
539acb3
fix(backend/copilot): always exclude MCP_TOOL from find_block, update…
majdyz Apr 15, 2026
34dbb9e
fix(backend/copilot): release dedup key in finally block — allow inte…
majdyz Apr 15, 2026
351d46c
fix(backend/executor): fix test patches to use billing.charge_extra_r…
majdyz Apr 15, 2026
1d0e030
refactor(backend/copilot): move file resolution to data layer, unify …
majdyz Apr 15, 2026
3409d6a
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
f5278b1
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
cfc4651
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
2244ce0
docs(backend/copilot): clarify graph-only block list and MCPToolBlock…
majdyz Apr 15, 2026
88f20d8
fix(copilot): address review comments — module-level multiplier const…
majdyz Apr 15, 2026
86c5d13
test(backend): mock get_proration_credit_cents in route tests and ass…
majdyz Apr 15, 2026
690f6f1
test(backend/copilot): add coverage for for_agent_generation flag in …
majdyz Apr 15, 2026
a2fc0ef
fix(backend/copilot): stable dedup hash + correct key lifecycle
majdyz Apr 15, 2026
d446421
fix(backend/executor): include base block cost in graph total cost
majdyz Apr 15, 2026
bffd159
test(backend/copilot): address review comments — fix guide doc and mo…
majdyz Apr 15, 2026
3937d47
fix(copilot): standard model tier uses _resolve_sdk_model() to respec…
majdyz Apr 15, 2026
df91d16
fix(platform): fix Stripe customer creation on FREE downgrade and dia…
majdyz Apr 15, 2026
50bfc3e
fix(backend/copilot): add test for redis delete failure path on early…
majdyz Apr 15, 2026
02e0ba3
fix(backend/executor): add cost field to NodeExecutionStats to fix At…
majdyz Apr 15, 2026
d6983e6
fix(backend/copilot): dedup guard covers attachment-only turns; remov…
majdyz Apr 15, 2026
6fe8e34
refactor(frontend/builder): decompose useBuilderChatPanel into focuse…
majdyz Apr 15, 2026
c9aa0e2
fix(backend/copilot): improve dedup tests — MockerFixture, side-effec…
majdyz Apr 15, 2026
246035a
fix(frontend/copilot): use isInflightRef to prevent duplicate /stream…
majdyz Apr 15, 2026
e44b691
fix(backend): guard get_proration_credit_cents against creating orpha…
majdyz Apr 15, 2026
64553c7
fix(backend): format routes_test.py to pass black lint check
majdyz Apr 15, 2026
656a5c0
fix(copilot): use Cpu icon for model toggle button
majdyz Apr 15, 2026
6b8e4a2
dx(frontend/builder): clarify why flowID ref is updated during render
majdyz Apr 15, 2026
e9b27f9
fix(backend): revert routes_test.py formatter artifacts that break CI…
majdyz Apr 15, 2026
8810e01
test(frontend/copilot): extend ChatInput tests to cover model toggle …
majdyz Apr 15, 2026
029349f
fix(backend): reapply black formatting to routes_test.py
majdyz Apr 15, 2026
0c4931b
fix(backend/copilot): null-safe token accumulation for OpenRouter nul…
majdyz Apr 15, 2026
813b07d
test(frontend/builder): add sendRawMessage unit tests
majdyz Apr 15, 2026
9bec342
fix(backend/chat): fix two broken tests in routes_test.py
majdyz Apr 15, 2026
547f0a9
fix(backend/chat): fix ActiveSession status type error in routes_test.py
majdyz Apr 15, 2026
224631c
refactor(backend/copilot): extract dedup logic into message_dedup module
majdyz Apr 15, 2026
e88fbf6
refactor(backend/copilot): remove LD per-user model override machinery
majdyz Apr 15, 2026
dcc3cd3
fix(backend): add missing AI SDK header to dedup-blocked SSE response
majdyz Apr 15, 2026
1c0ebe8
fix(backend): add AI SDK protocol headers to empty SSE dedup response
majdyz Apr 15, 2026
71d684a
fix(frontend/builder): add 64k char guard to sendRawMessage + test
majdyz Apr 15, 2026
1b67d4c
fix(backend/copilot): make system prompt fully static for cross-user …
majdyz Apr 15, 2026
b8d1857
fix(copilot): expose MCPToolBlock via find_block when for_agent_gener…
majdyz Apr 15, 2026
220233d
fix(frontend/builder): remove unused isGraphLoaded prop and redundant…
majdyz Apr 15, 2026
05b7859
feat(frontend/copilot): persist chat mode preference to localStorage
majdyz Apr 15, 2026
728d3cd
refactor(backend/copilot): consolidate dedup release into single fina…
majdyz Apr 15, 2026
0279bab
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
dfb7f32
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
478249f
rename: release_dedup_on_exit → release_dedup_lock_on_exit
majdyz Apr 15, 2026
dae4972
fix(backend/copilot): sanitize memory_context tags from user input an…
majdyz Apr 15, 2026
a042c84
refactor(backend/copilot): extract _apply_token_usage helper and para…
majdyz Apr 15, 2026
128b553
fix(copilot): resolve merge conflict + add copilotLlmModel store tests
majdyz Apr 15, 2026
b589b37
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
majdyz Apr 15, 2026
c68c7d7
refactor(backend/copilot): remove unused cwd param from get_sdk_suppl…
majdyz Apr 15, 2026
9edd733
merge: feat/builder-chat-panel
majdyz Apr 15, 2026
0ba3729
merge: feat/subscription-tier-billing
majdyz Apr 15, 2026
f959aa6
merge: fix/orchestrator-per-iteration-cost
majdyz Apr 15, 2026
b109a97
merge: feat/copilot-pending-messages
majdyz Apr 15, 2026
6833ca4
merge: fix/copilot-duplicate-message-guard
majdyz Apr 15, 2026
2824753
merge: feat/agent-intelligence-layer
majdyz Apr 15, 2026
e0a8bc5
fix(backend/copilot): reformat assert statements to pass black lint
majdyz Apr 15, 2026
b32b5b2
merge: fix/copilot-stream-disconnect-on-session-switch
majdyz Apr 15, 2026
f6a4279
merge: fix/openrouter-null-cache-tokens
majdyz Apr 15, 2026
8916468
merge: feat/find-block-agent-generation-flag
majdyz Apr 15, 2026
05da07f
merge: fix/copilot-static-system-prompt
majdyz Apr 15, 2026
6e56c29
merge: feat/copilot-model-targeting-flag
majdyz Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
311 changes: 271 additions & 40 deletions autogpt_platform/backend/backend/api/features/chat/routes.py

Large diffs are not rendered by default.

1,436 changes: 1,423 additions & 13 deletions autogpt_platform/backend/backend/api/features/chat/routes_test.py

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions autogpt_platform/backend/backend/api/features/library/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@
integration_creds_manager = IntegrationCredentialsManager()


async def _fetch_execution_counts(user_id: str, graph_ids: list[str]) -> dict[str, int]:
"""Fetch execution counts per graph in a single batched query."""
if not graph_ids:
return {}
rows = await prisma.models.AgentGraphExecution.prisma().group_by(
by=["agentGraphId"],
where={
"userId": user_id,
"agentGraphId": {"in": graph_ids},
"isDeleted": False,
},
count=True,
)
return {
row["agentGraphId"]: int((row.get("_count") or {}).get("_all") or 0)
for row in rows
}


async def list_library_agents(
user_id: str,
search_term: Optional[str] = None,
Expand Down Expand Up @@ -137,12 +156,18 @@ async def list_library_agents(

logger.debug(f"Retrieved {len(library_agents)} library agents for user #{user_id}")

graph_ids = [a.agentGraphId for a in library_agents if a.agentGraphId]
execution_counts = await _fetch_execution_counts(user_id, graph_ids)

# Only pass valid agents to the response
valid_library_agents: list[library_model.LibraryAgent] = []

for agent in library_agents:
try:
library_agent = library_model.LibraryAgent.from_db(agent)
library_agent = library_model.LibraryAgent.from_db(
agent,
execution_count_override=execution_counts.get(agent.agentGraphId),
)
valid_library_agents.append(library_agent)
except Exception as e:
# Skip this agent if there was an error
Expand Down Expand Up @@ -214,12 +239,18 @@ async def list_favorite_library_agents(
f"Retrieved {len(library_agents)} favorite library agents for user #{user_id}"
)

graph_ids = [a.agentGraphId for a in library_agents if a.agentGraphId]
execution_counts = await _fetch_execution_counts(user_id, graph_ids)

# Only pass valid agents to the response
valid_library_agents: list[library_model.LibraryAgent] = []

for agent in library_agents:
try:
library_agent = library_model.LibraryAgent.from_db(agent)
library_agent = library_model.LibraryAgent.from_db(
agent,
execution_count_override=execution_counts.get(agent.agentGraphId),
)
valid_library_agents.append(library_agent)
except Exception as e:
# Skip this agent if there was an error
Expand Down
138 changes: 138 additions & 0 deletions autogpt_platform/backend/backend/api/features/library/db_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ async def test_get_library_agents(mocker):
)
mock_library_agent.return_value.count = mocker.AsyncMock(return_value=1)

mocker.patch(
"backend.api.features.library.db._fetch_execution_counts",
new=mocker.AsyncMock(return_value={}),
)

# Call function
result = await db.list_library_agents("test-user")

Expand Down Expand Up @@ -353,3 +358,136 @@ async def fake_tx():
# Verify update branch restores soft-deleted/archived agents
assert data["update"]["isDeleted"] is False
assert data["update"]["isArchived"] is False


@pytest.mark.asyncio
async def test_list_favorite_library_agents(mocker):
mock_library_agents = [
prisma.models.LibraryAgent(
id="fav1",
userId="test-user",
agentGraphId="agent-fav",
settings="{}", # type: ignore
agentGraphVersion=1,
isCreatedByUser=False,
isDeleted=False,
isArchived=False,
createdAt=datetime.now(),
updatedAt=datetime.now(),
isFavorite=True,
useGraphIsActiveVersion=True,
AgentGraph=prisma.models.AgentGraph(
id="agent-fav",
version=1,
name="Favorite Agent",
description="My Favorite",
userId="other-user",
isActive=True,
createdAt=datetime.now(),
),
)
]

mock_library_agent = mocker.patch("prisma.models.LibraryAgent.prisma")
mock_library_agent.return_value.find_many = mocker.AsyncMock(
return_value=mock_library_agents
)
mock_library_agent.return_value.count = mocker.AsyncMock(return_value=1)

mocker.patch(
"backend.api.features.library.db._fetch_execution_counts",
new=mocker.AsyncMock(return_value={"agent-fav": 7}),
)

result = await db.list_favorite_library_agents("test-user")

assert len(result.agents) == 1
assert result.agents[0].id == "fav1"
assert result.agents[0].name == "Favorite Agent"
assert result.agents[0].graph_id == "agent-fav"
assert result.pagination.total_items == 1
assert result.pagination.total_pages == 1
assert result.pagination.current_page == 1
assert result.pagination.page_size == 50


@pytest.mark.asyncio
async def test_list_library_agents_skips_failed_agent(mocker):
"""Agents that fail parsing should be skipped — covers the except branch."""
mock_library_agents = [
prisma.models.LibraryAgent(
id="ua-bad",
userId="test-user",
agentGraphId="agent-bad",
settings="{}", # type: ignore
agentGraphVersion=1,
isCreatedByUser=False,
isDeleted=False,
isArchived=False,
createdAt=datetime.now(),
updatedAt=datetime.now(),
isFavorite=False,
useGraphIsActiveVersion=True,
AgentGraph=prisma.models.AgentGraph(
id="agent-bad",
version=1,
name="Bad Agent",
description="",
userId="other-user",
isActive=True,
createdAt=datetime.now(),
),
)
]

mock_library_agent = mocker.patch("prisma.models.LibraryAgent.prisma")
mock_library_agent.return_value.find_many = mocker.AsyncMock(
return_value=mock_library_agents
)
mock_library_agent.return_value.count = mocker.AsyncMock(return_value=1)

mocker.patch(
"backend.api.features.library.db._fetch_execution_counts",
new=mocker.AsyncMock(return_value={}),
)
mocker.patch(
"backend.api.features.library.model.LibraryAgent.from_db",
side_effect=Exception("parse error"),
)

result = await db.list_library_agents("test-user")

assert len(result.agents) == 0
assert result.pagination.total_items == 1


@pytest.mark.asyncio
async def test_fetch_execution_counts_empty_graph_ids():
result = await db._fetch_execution_counts("user-1", [])
assert result == {}


@pytest.mark.asyncio
async def test_fetch_execution_counts_uses_group_by(mocker):
mock_prisma = mocker.patch("prisma.models.AgentGraphExecution.prisma")
mock_prisma.return_value.group_by = mocker.AsyncMock(
return_value=[
{"agentGraphId": "graph-1", "_count": {"_all": 5}},
{"agentGraphId": "graph-2", "_count": {"_all": 2}},
]
)

result = await db._fetch_execution_counts(
"user-1", ["graph-1", "graph-2", "graph-3"]
)

assert result == {"graph-1": 5, "graph-2": 2}
mock_prisma.return_value.group_by.assert_called_once_with(
by=["agentGraphId"],
where={
"userId": "user-1",
"agentGraphId": {"in": ["graph-1", "graph-2", "graph-3"]},
"isDeleted": False,
},
count=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def from_db(
sub_graphs: Optional[list[prisma.models.AgentGraph]] = None,
store_listing: Optional[prisma.models.StoreListing] = None,
profile: Optional[prisma.models.Profile] = None,
execution_count_override: Optional[int] = None,
) -> "LibraryAgent":
"""
Factory method that constructs a LibraryAgent from a Prisma LibraryAgent
Expand Down Expand Up @@ -258,10 +259,14 @@ def from_db(
status = status_result.status
new_output = status_result.new_output

execution_count = len(executions)
execution_count = (
execution_count_override
if execution_count_override is not None
else len(executions)
)
success_rate: float | None = None
avg_correctness_score: float | None = None
if execution_count > 0:
if executions and execution_count > 0:
success_count = sum(
1
for e in executions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,66 @@
import datetime

import prisma.enums
import prisma.models
import pytest

from . import model as library_model


def _make_library_agent(
*,
graph_id: str = "g1",
executions: list | None = None,
) -> prisma.models.LibraryAgent:
return prisma.models.LibraryAgent(
id="la1",
userId="u1",
agentGraphId=graph_id,
settings="{}", # type: ignore
agentGraphVersion=1,
isCreatedByUser=True,
isDeleted=False,
isArchived=False,
createdAt=datetime.datetime.now(),
updatedAt=datetime.datetime.now(),
isFavorite=False,
useGraphIsActiveVersion=True,
AgentGraph=prisma.models.AgentGraph(
id=graph_id,
version=1,
name="Agent",
description="Desc",
userId="u1",
isActive=True,
createdAt=datetime.datetime.now(),
Executions=executions,
),
)


def test_from_db_execution_count_override_covers_success_rate():
"""Covers execution_count_override is not None branch and executions/count > 0 block."""
now = datetime.datetime.now(datetime.timezone.utc)
exec1 = prisma.models.AgentGraphExecution(
id="exec-1",
agentGraphId="g1",
agentGraphVersion=1,
userId="u1",
executionStatus=prisma.enums.AgentExecutionStatus.COMPLETED,
createdAt=now,
updatedAt=now,
isDeleted=False,
isShared=False,
)
agent = _make_library_agent(executions=[exec1])

result = library_model.LibraryAgent.from_db(agent, execution_count_override=1)

assert result.execution_count == 1
assert result.success_rate is not None
assert result.success_rate == 100.0


@pytest.mark.asyncio
async def test_agent_preset_from_db(test_user_id: str):
# Create mock DB agent
Expand Down
Loading
Loading