[FIX] viin_ai_base,viin_ai_agent,viin_ai_memory: Cognitive Wave-1 agent-loop remediation
Independent review of the cluster surfaced 1 install blocker plus agent-loop
defects that left Wave-1 tool/skill execution non-functional in production.
- viin_ai_memory: declare the missing viin_ai_agent dependency. Standalone
install crashed at Python import (the module imports prompt_safety and
_inherits viin.ai.agent); it only worked when co-installed with skill/pulse.
- viin_ai_base: _normalize_completion_response now emits stop_reason in all
three provider branches (anthropic/google/openai). Without it the agent loop
terminated after iteration 1 and no tool ever executed in production.
- viin_ai_base: normalize tool_call shape to canonical {id,name,arguments} for
anthropic (input->arguments) and openai (hoist function.name/arguments) so
tools dispatch end-to-end on every provider, not just google_native.
- viin_ai_agent: _execute_tool_call injects viin_ai_tool_args into the action
context (tools were receiving empty args) and surfaces the tool_result data
payload instead of a hardcoded 'executed'.
Each fix ships with a RED-first test that drives the real production path
(real normalizer, transport-only stub), closing the prior harness blind spot
where mocks injected the missing stop_reason and masked the defect.
| Subbuilds | Name | State | Detail |
|---|---|---|---|
| Build 385688 | Check the quality with Pylint: from test_lint to test_pylint 14m | Failed | Log |
| Build 385689 | At install tests: from account to website_twitter 150m | Succeed | Log |
| Build 385690 | Post install tests: step install all modules 79m | Succeed | Log |
| Build 385691 | Post install tests: from account to payment_authorize 184m | Succeed | Log |
| Build 385692 | Post install tests: from payment_bidv_viin to theme_default 219m | Failed | Log |
| Build 385693 | Post install tests: from to_account_accountant to transifex 78m | Succeed | Log |
| Build 385694 | Post install tests: from uom to viin_estimate_approval 89m | Failed | Log |
| Build 385695 | Post install tests: from viin_estimate_budget to viin_project 34m | Succeed | Log |
| Build 385696 | Post install tests: from viin_project_access_timesheet to website_twitter 58m | Succeed | Log |
| Build 385697 | Test install all modules without demo data: from account to website_twitter 59m | Succeed | Log |
| Create Date | Level | Message |
|---|---|---|
| 06/15/2026 13:30:15 | INFO |
Updated repository Viindoo-odoo
|
| 06/15/2026 13:30:15 | INFO |
Updated repository Viindoo-tvtmaaddons
|
| 06/15/2026 13:30:15 | INFO |
Updated repository Viindoo-erponline-enterprise
|
| 06/15/2026 13:30:15 | INFO |
Updated repository Viindoo-branding
|
| 06/15/2026 13:30:15 | INFO |
Cloned repository Viindoo-ai
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.addons.test_lint.tests.test_manifests: FAIL: Subtest ManifestLinter.test_manifests (module='viin_ai_memory')
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/odoo/addons/test_lint/tests/test_manifests.py", line 44, in test_manifests
self._test_manifest_values(module, manifest_data)
File "/data/build/Viindoo-tvtmaaddons-17.0/to_base/__init__.py", line 362, in _test_manifest_values_plus
_test_manifest_values(self, module, manifest_data)
File "/data/build/Viindoo-odoo-17.0/odoo/addons/test_lint/tests/test_manifests.py", line 68, in _test_manifest_values
self.assertNotEqual(
AssertionError: False == False : Setting manifest key auto_install to the default manifest value for module 'viin_ai_memory'. You can remove this key from the dict to reduce noise/inconsistencies between manifests specifications and ease understanding of manifest content.
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.modules.loading: Module test_lint: 1 failures, 0 errors of 15 tests
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.addons.test_pylint.tests.test_flake8: FAIL: TestFlake8.test_flake8
Traceback (most recent call last):
File "/data/build/Viindoo-tvtmaaddons-17.0/test_pylint/tests/test_flake8.py", line 91, in test_flake8
self.fail("flake8 test failed:\n" + (b"\n" + out + b"\n" + err).decode('utf-8').strip())
AssertionError: flake8 test failed:
/data/build/rb-929352b-222188/viin_ai_skill/tests/test_cowork_bundle.py:190:1: W391 blank line at end of file
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.modules.loading: Module test_pylint: 1 failures, 0 errors of 7 tests
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.modules.loading: At least one test failed when loading the modules.
|
| 06/15/2026 13:45:20 | ERROR |
Subbuild # 385688:
odoo.tests.result: 2 failed, 0 error(s) of 24 tests when loading database 'rb-929352b-222188-385688'
|
| 06/15/2026 16:00:59 | WARNING |
Subbuild # 385689:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 14:50:41 | WARNING |
Subbuild # 385690:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 18:30:17 | ERROR |
Subbuild # 385692:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 18:30:17 | ERROR |
Subbuild # 385692:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (1, 1, '0.00000000', '2026-06-15 11:09:45.916258', 1, 106, 'Provider unreachable: https://api.openai.com/v1/chat/completions', 0, '2026-06-15', 56, 19, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 11:09:45.916258', 1) RETURNING "id"
DETAIL: Key (provider_id)=(19) is not present in table "viin_ai_provider".
|
| 06/15/2026 18:30:17 | WARNING |
Subbuild # 385692:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_base/models/provider.py", line 1140, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(19) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:10:03 | WARNING |
Subbuild # 385693:
odoo.addons.base.models.ir_ui_view: Error-prone use of @class in view viin.ai.work.routine.form.inherit.pulse (viin_ai_pulse.viin_ai_work_routine_view_form): use the hasclass(*classes) function to filter elements by their classes
|
| 06/15/2026 16:10:03 | WARNING |
Subbuild # 385693:
odoo.addons.to_base.tests.test_validate_record_rules:
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_create=False', because 'base.group_user' group has 'perm_create=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_write=False', because 'base.group_user' group has 'perm_write=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_promotion_log_rule_owner' rule: You should set 'perm_unlink=False', because 'base.group_user' group has 'perm_unlink=False' on model 'viin.ai.memory.promotion.log'.
'viin_ai_memory.viin_ai_memory_observation_rule_owner' rule: You should set 'perm_write=False', because 'base.group_user' group has 'perm_write=False' on model 'viin.ai.memory.observation'.
'viin_ai_memory.viin_ai_memory_observation_rule_owner' rule: You should set 'perm_unlink=False', because 'base.group_user' group has 'perm_unlink=False' on model 'viin.ai.memory.observation'.
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_agent.models.agent: viin.ai.agent._execute_tool_call: tool=wi2a_sudo_tool failed: Tool wi2a_sudo_tool requests sudo execution but base.group_system is not in its allowed groups - refusing to escalate.
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_agent/models/agent.py", line 516, in _execute_tool_call
raise AccessError(_(
odoo.exceptions.AccessError: Tool wi2a_sudo_tool requests sudo execution but base.group_system is not in its allowed groups - refusing to escalate.
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_approval.models.viin_approval_request: viin_ai_approval: advisory agent 30 carries executable tools; refusing to run a read-only advisory with tools (request 3).
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_approval.models.viin_approval_request: viin_ai_approval: advisory agent Sale Approval Risk Advisor (id=5) has 1 topic(s) but topic_ids.tool_ids resolved to an empty recordset for principal uid=1 - this may indicate a missing viin.ai.tool read ACL on the cron principal; advisory will run tool-less.
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 08:30:40.571624', 1, 0, 'Provider error (401): invalid api key', 0, '2026-06-15', 92, 61, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 08:30:40.571624', 1) RETURNING "id"
DETAIL: Key (provider_id)=(61) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_base/models/provider.py", line 1140, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(61) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 08:30:40.636438', 1, 0, 'Provider unreachable: https://api.openai.com/v1/chat/completions', 0, '2026-06-15', 92, 61, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 08:30:40.636438', 1) RETURNING "id"
DETAIL: Key (provider_id)=(61) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_base/models/provider.py", line 1140, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(61) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
ERROR: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.sql_db: bad query: INSERT INTO "viin_ai_usage_log" ("api_log_ref", "company_id", "cost_usd", "create_date", "create_uid", "duration_ms", "error_message", "iteration_index", "log_date", "model_id", "provider_id", "res_id", "res_model", "status", "tokens_input", "tokens_output", "trace_id", "user_id", "write_date", "write_uid") VALUES (0, 1, '0.00000000', '2026-06-15 08:31:11.213974', 1, 78, 'Provider unreachable: https://api.openai.com/v1/embeddings', 0, '2026-06-15', 112, 96, 0, NULL, 'error', 0, 0, NULL, 1, '2026-06-15 08:31:11.213974', 1) RETURNING "id"
DETAIL: Key (provider_id)=(96) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | WARNING |
Subbuild # 385694:
odoo.addons.viin_ai_base.models.provider: viin_ai_base: could not write error usage.log
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_base/models/provider.py", line 1140, in _record_error_usage
err_env['viin.ai.usage.log'].sudo().create(log_vals)
File "<decorator-gen-12>", line 2, in create
File "/data/build/Viindoo-odoo-17.0/odoo/api.py", line 430, in _model_create_multi
return create(self, [arg])
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4656, in create
records = self._create(data_list)
File "/data/build/Viindoo-odoo-17.0/odoo/models.py", line 4844, in _create
cr.execute(SQL(
File "/data/build/Viindoo-odoo-17.0/odoo/sql_db.py", line 342, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "viin_ai_usage_log" violates foreign key constraint "viin_ai_usage_log_provider_id_fkey"
DETAIL: Key (provider_id)=(96) is not present in table "viin_ai_provider".
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.addons.viin_ai_chat.controllers.chat_controller: chat_message failed for agent 1
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_chat/controllers/chat_controller.py", line 70, in chat_message
result = agent.run(messages, context=context)
File "/data/build/rb-929352b-222188/viin_ai_agent/models/agent.py", line 795, in run
system = self._assemble_system_prompt(
TypeError: TestChatController.test_context_res_model_res_id_forwarded.<locals>._capture_assemble() got an unexpected keyword argument 'applied_skills'
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.addons.viin_ai_chat.tests.test_chat_controller: ERROR: TestChatController.test_context_res_model_res_id_forwarded
Traceback (most recent call last):
File "/data/build/rb-929352b-222188/viin_ai_chat/tests/test_chat_controller.py", line 164, in test_context_res_model_res_id_forwarded
self.assertEqual(captured_context['ctx'],
KeyError: 'ctx'
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.addons.viin_ai_chat.tests.test_chat_controller: FAIL: TestChatController.test_user_error_passed_through
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/odoo/tools/misc.py", line 825, in deco
return func(*args, **kwargs)
File "/data/build/rb-929352b-222188/viin_ai_chat/tests/test_chat_controller.py", line 242, in test_user_error_passed_through
self.assertIn('error', payload, payload)
AssertionError: 'error' not found in {'jsonrpc': '2.0', 'id': None, 'result': {'status': 'error', 'content': 'Agent error: TestChatController.test_user_error_passed_through.<locals>._user_err() takes 1 positional argument but 2 were given', 'trace_id': None, 'iterations': 0, 'cost_usd': 0.0, 'tool_calls': 0}} : {'jsonrpc': '2.0', 'id': None, 'result': {'status': 'error', 'content': 'Agent error: TestChatController.test_user_error_passed_through.<locals>._user_err() takes 1 positional argument but 2 were given', 'trace_id': None, 'iterations': 0, 'cost_usd': 0.0, 'tool_calls': 0}}
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.addons.mail.models.mail_mail: failed sending mail (id: 352) due to You must either provide a sender address explicitly or configure using the combination of `mail.catchall.domain` and `mail.default.from` ICPs, in the server configuration file or with the --email-from startup parameter.
Traceback (most recent call last):
File "/data/build/Viindoo-odoo-17.0/addons/mail/models/mail_mail.py", line 664, in _send
msg = SendIrMailServer.build_email(
File "/data/build/Viindoo-odoo-17.0/odoo/addons/base/models/ir_mail_server.py", line 526, in build_email
assert email_from, self.NO_FOUND_FROM
AssertionError: You must either provide a sender address explicitly or configure using the combination of `mail.catchall.domain` and `mail.default.from` ICPs, in the server configuration file or with the --email-from startup parameter.
|
| 06/15/2026 16:20:38 | ERROR |
Subbuild # 385694:
odoo.tests.result: 1 failed, 1 error(s) of 2091 tests when loading database 'rb-929352b-222188-385694'
|