teddy-cli 0.2.3.dev1531__tar.gz → 0.2.3.dev1533__tar.gz

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.
Files changed (166) hide show
  1. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/PKG-INFO +43 -1
  2. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/README.md +42 -0
  3. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/pyproject.toml +1 -1
  4. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/__main__.py +9 -2
  5. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/session_cli_handlers.py +36 -23
  6. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/litellm_adapter.py +25 -18
  7. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/config_schema.py +94 -1
  8. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/get_context_use_case.py +4 -1
  9. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/llm_client.py +4 -1
  10. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/context_service.py +18 -4
  11. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/planning_service.py +59 -26
  12. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_orchestrator.py +20 -2
  13. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_service.py +4 -1
  14. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/update_checker.py +15 -9
  15. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/config.yaml +15 -0
  16. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/.gitignore +0 -0
  17. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/LICENSE +0 -0
  18. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/__init__.py +0 -0
  19. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/__init__.py +0 -0
  20. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/__init__.py +0 -0
  21. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/cli_formatter.py +0 -0
  22. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/cli_helpers.py +0 -0
  23. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer.py +0 -0
  24. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_app.py +0 -0
  25. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_editor.py +0 -0
  26. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_execution.py +0 -0
  27. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_helpers.py +0 -0
  28. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_logic.py +0 -0
  29. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_previews.py +0 -0
  30. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/inbound/textual_plan_reviewer_widgets.py +0 -0
  31. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/__init__.py +0 -0
  32. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/console_interactor.py +0 -0
  33. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/console_interactor_ask_loop.py +0 -0
  34. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/console_interactor_helpers.py +0 -0
  35. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/console_tooling.py +0 -0
  36. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/filesystem_helpers.py +0 -0
  37. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/local_file_system_adapter.py +0 -0
  38. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/local_repo_tree_generator.py +0 -0
  39. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/openrouter_hydrator.py +0 -0
  40. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/shell_adapter.py +0 -0
  41. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/shell_command_builder.py +0 -0
  42. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/suppressed_logging.py +0 -0
  43. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/system_environment_adapter.py +0 -0
  44. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/system_environment_inspector.py +0 -0
  45. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/system_time_adapter.py +0 -0
  46. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/terminal_quit_key_listener.py +0 -0
  47. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/web_scraper_adapter.py +0 -0
  48. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/web_searcher_adapter.py +0 -0
  49. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/adapters/outbound/yaml_config_adapter.py +0 -0
  50. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/container.py +0 -0
  51. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/__init__.py +0 -0
  52. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/__init__.py +0 -0
  53. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/__init__.py +0 -0
  54. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/action_ports.py +0 -0
  55. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/change_set.py +0 -0
  56. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/drift_report.py +0 -0
  57. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/exceptions.py +0 -0
  58. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/execution_report.py +0 -0
  59. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/orchestrator_ports.py +0 -0
  60. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/plan.py +0 -0
  61. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/planning_ports.py +0 -0
  62. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/project_context.py +0 -0
  63. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/report_assembly_data.py +0 -0
  64. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/session.py +0 -0
  65. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/shell_output.py +0 -0
  66. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/domain/models/web_search_results.py +0 -0
  67. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/__init__.py +0 -0
  68. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/__init__.py +0 -0
  69. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/edit_simulator.py +0 -0
  70. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/init.py +0 -0
  71. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/plan_parser.py +0 -0
  72. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/plan_reviewer.py +0 -0
  73. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/plan_validator.py +0 -0
  74. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/planning_use_case.py +0 -0
  75. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/inbound/run_plan_use_case.py +0 -0
  76. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/__init__.py +0 -0
  77. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/config_service.py +0 -0
  78. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/environment_inspector.py +0 -0
  79. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/execution_report_assembler.py +0 -0
  80. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/file_system_manager.py +0 -0
  81. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/markdown_report_formatter.py +0 -0
  82. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/prompt_manager.py +0 -0
  83. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/quit_key_listener.py +0 -0
  84. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/repo_tree_generator.py +0 -0
  85. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/session_loop_guard.py +0 -0
  86. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/session_manager.py +0 -0
  87. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/session_repository.py +0 -0
  88. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/shell_executor.py +0 -0
  89. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/system_environment.py +0 -0
  90. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/time_service.py +0 -0
  91. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/user_interactor.py +0 -0
  92. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/web_scraper.py +0 -0
  93. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/ports/outbound/web_searcher.py +0 -0
  94. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/__init__.py +0 -0
  95. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_changeset_builder.py +0 -0
  96. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_diff_manager.py +0 -0
  97. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_dispatcher.py +0 -0
  98. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_executor.py +0 -0
  99. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_factory.py +0 -0
  100. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_parser_complex.py +0 -0
  101. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/action_parser_strategies.py +0 -0
  102. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/edit_simulator.py +0 -0
  103. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/execution_orchestrator.py +0 -0
  104. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/execution_report_assembler.py +0 -0
  105. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/init_service.py +0 -0
  106. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/markdown_plan_parser.py +0 -0
  107. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/markdown_report_formatter.py +0 -0
  108. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/parser_infrastructure.py +0 -0
  109. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/parser_metadata.py +0 -0
  110. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/parser_reporting.py +0 -0
  111. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/plan_validator.py +0 -0
  112. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/prompt_manager.py +0 -0
  113. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_lifecycle_manager.py +0 -0
  114. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_loop_guard.py +0 -0
  115. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_planner.py +0 -0
  116. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_pruning_service.py +0 -0
  117. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_replanner.py +0 -0
  118. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/session_repository.py +0 -0
  119. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/templates/execution_report.md.j2 +0 -0
  120. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/__init__.py +0 -0
  121. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/edit.py +0 -0
  122. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/edit_matcher.py +0 -0
  123. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/edit_matcher_heuristics.py +0 -0
  124. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/execute.py +0 -0
  125. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/filesystem.py +0 -0
  126. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/helpers.py +0 -0
  127. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/services/validation_rules/message.py +0 -0
  128. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/__init__.py +0 -0
  129. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/diff.py +0 -0
  130. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/editor_names.py +0 -0
  131. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/interrupt_guard.py +0 -0
  132. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/interruptible_call.py +0 -0
  133. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/io.py +0 -0
  134. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/markdown.py +0 -0
  135. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/message_renderer.py +0 -0
  136. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/paths.py +0 -0
  137. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/serialization.py +0 -0
  138. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/session_notices.py +0 -0
  139. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/stdin_ownership.py +0 -0
  140. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/string.py +0 -0
  141. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/core/utils/terminal.py +0 -0
  142. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/prompts.py +0 -0
  143. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/registries/__init__.py +0 -0
  144. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/registries/infrastructure.py +0 -0
  145. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/registries/reviewer.py +0 -0
  146. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/registries/validators.py +0 -0
  147. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/MRP.md +0 -0
  148. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/__init__.py +0 -0
  149. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/__init__.py +0 -0
  150. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/init.context +0 -0
  151. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/architect.md +0 -0
  152. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/assistant.md +0 -0
  153. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/debugger.md +0 -0
  154. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/developer.md +0 -0
  155. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/pathfinder.md +0 -0
  156. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/config/prompts/prototyper.md +0 -0
  157. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/ARCHITECTURE.md +0 -0
  158. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/PROJECT.md +0 -0
  159. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/case-file.md +0 -0
  160. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/ci.md +0 -0
  161. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/component-design.md +0 -0
  162. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/makefile.md +0 -0
  163. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/milestone.md +0 -0
  164. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/pre-commit.md +0 -0
  165. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/specification-document.md +0 -0
  166. {teddy_cli-0.2.3.dev1531 → teddy_cli-0.2.3.dev1533}/src/teddy_executor/resources/templates/vertical-slice.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: teddy-cli
3
- Version: 0.2.3.dev1531
3
+ Version: 0.2.3.dev1533
4
4
  Summary: The local-first, test-driven agentic engineering harness. Because you should own the means of development.
5
5
  Author: Raphael Atteritano
6
6
  License: AGPL-3.0-only
@@ -194,6 +194,35 @@ uv tool install teddy-cli --pre --force
194
194
  > [!WARNING]
195
195
  > Experimental versions are published as PEP 440 dev pre-releases on PyPI and may include breaking changes or unstable features.
196
196
 
197
+ ### Installing From a Fork or Private Index
198
+
199
+ TeDDy can run from a fork or a private package index, and the update check can follow the same source. Because the version check reads the installed `teddy-cli` distribution metadata, every install shape must keep the distribution name `teddy-cli` — a git install, a local wheel, and a private index all do. Only a public PyPI upload under a different name would need a second knob.
200
+
201
+ Install from a git URL:
202
+
203
+ ```bash
204
+ uv tool install git+https://github.com/<you>/teddy
205
+ ```
206
+
207
+ Install from a private index:
208
+
209
+ ```bash
210
+ uv tool install teddy-cli --default-index https://packages.example.com/simple
211
+ ```
212
+
213
+ Then point the update check at your own source by setting `update.index_url` in `.teddy/config.yaml`:
214
+
215
+ ```yaml
216
+ update:
217
+ index_url: "https://packages.example.com/pypi/teddy-cli/json"
218
+ ```
219
+
220
+ The source only needs to be PyPI-JSON-shaped. A static `version.json` served from your fork's repository works too, as long as it carries `{"info": {"version": "x.y.z"}}`. That `info.version` fallback ignores `--experimental`, so a static source reports the same version with or without the flag.
221
+
222
+ `uv tool upgrade teddy-cli` re-resolves the upgrade from the index recorded in its install receipt, so a fork installed from a private index upgrades in place. A git install upgrades by reinstalling from the same git URL.
223
+
224
+ `teddy update` reads `.teddy/config.yaml` from the current directory, so run it from the project root. The `checks.update: false` toggle silences the startup notice only; the background fetch still runs, and `teddy update` always compares against the configured source.
225
+
197
226
  ### Initialize
198
227
 
199
228
  ```bash
@@ -212,6 +241,19 @@ Each subcommand rewrites only the files whose content differs from the bundled d
212
241
 
213
242
  The first execution of `teddy start` runs an interactive setup to configure your API key and preferred editor. For deeper customization, edit `.teddy/config.yaml`. All `llm.*` settings pass directly through to [LiteLLM](https://docs.litellm.ai/docs/completion/input), allowing you to route to cloud providers or local endpoints (Ollama, llama.cpp, or any OpenAI-compatible server via `api_base`). The config file also lets you adjust your external editor, command execution timeouts, diff similarity thresholds, and automated context pruning budgets.
214
243
 
244
+ To route one agent persona to its own model while `llm.*` stays the shared default, add an `agents` block. The effective model resolves from the `--model` flag first, then `agents.<persona>.model`, then `llm.model`, and every key the persona omits still falls back to the global `llm` block. `--model` replaces only the `model` key, so a persona-level `api_key` or `api_base` still applies. The merge is one level deep: a mapping-valued key such as `extra_headers` replaces the global value wholesale rather than merging key by key. An empty or whitespace-only persona model falls back to `llm.model`, and persona names match case-insensitively.
245
+
246
+ ```yaml
247
+ llm:
248
+ model: "openai/gpt-4o"
249
+ timeout: 300
250
+ agents:
251
+ architect:
252
+ model: "anthropic/claude-sonnet-4-5"
253
+ ```
254
+
255
+ The API-key setup prompt reads only the global `llm.api_key`, so a persona-level `api_key` does not suppress it: when `llm.api_key` is empty the prompt still fires, and validation then reports against the merged key.
256
+
215
257
  ### Environment Variables
216
258
 
217
259
  TeDDy checks the following process environment variables at startup and during a session.
@@ -159,6 +159,35 @@ uv tool install teddy-cli --pre --force
159
159
  > [!WARNING]
160
160
  > Experimental versions are published as PEP 440 dev pre-releases on PyPI and may include breaking changes or unstable features.
161
161
 
162
+ ### Installing From a Fork or Private Index
163
+
164
+ TeDDy can run from a fork or a private package index, and the update check can follow the same source. Because the version check reads the installed `teddy-cli` distribution metadata, every install shape must keep the distribution name `teddy-cli` — a git install, a local wheel, and a private index all do. Only a public PyPI upload under a different name would need a second knob.
165
+
166
+ Install from a git URL:
167
+
168
+ ```bash
169
+ uv tool install git+https://github.com/<you>/teddy
170
+ ```
171
+
172
+ Install from a private index:
173
+
174
+ ```bash
175
+ uv tool install teddy-cli --default-index https://packages.example.com/simple
176
+ ```
177
+
178
+ Then point the update check at your own source by setting `update.index_url` in `.teddy/config.yaml`:
179
+
180
+ ```yaml
181
+ update:
182
+ index_url: "https://packages.example.com/pypi/teddy-cli/json"
183
+ ```
184
+
185
+ The source only needs to be PyPI-JSON-shaped. A static `version.json` served from your fork's repository works too, as long as it carries `{"info": {"version": "x.y.z"}}`. That `info.version` fallback ignores `--experimental`, so a static source reports the same version with or without the flag.
186
+
187
+ `uv tool upgrade teddy-cli` re-resolves the upgrade from the index recorded in its install receipt, so a fork installed from a private index upgrades in place. A git install upgrades by reinstalling from the same git URL.
188
+
189
+ `teddy update` reads `.teddy/config.yaml` from the current directory, so run it from the project root. The `checks.update: false` toggle silences the startup notice only; the background fetch still runs, and `teddy update` always compares against the configured source.
190
+
162
191
  ### Initialize
163
192
 
164
193
  ```bash
@@ -177,6 +206,19 @@ Each subcommand rewrites only the files whose content differs from the bundled d
177
206
 
178
207
  The first execution of `teddy start` runs an interactive setup to configure your API key and preferred editor. For deeper customization, edit `.teddy/config.yaml`. All `llm.*` settings pass directly through to [LiteLLM](https://docs.litellm.ai/docs/completion/input), allowing you to route to cloud providers or local endpoints (Ollama, llama.cpp, or any OpenAI-compatible server via `api_base`). The config file also lets you adjust your external editor, command execution timeouts, diff similarity thresholds, and automated context pruning budgets.
179
208
 
209
+ To route one agent persona to its own model while `llm.*` stays the shared default, add an `agents` block. The effective model resolves from the `--model` flag first, then `agents.<persona>.model`, then `llm.model`, and every key the persona omits still falls back to the global `llm` block. `--model` replaces only the `model` key, so a persona-level `api_key` or `api_base` still applies. The merge is one level deep: a mapping-valued key such as `extra_headers` replaces the global value wholesale rather than merging key by key. An empty or whitespace-only persona model falls back to `llm.model`, and persona names match case-insensitively.
210
+
211
+ ```yaml
212
+ llm:
213
+ model: "openai/gpt-4o"
214
+ timeout: 300
215
+ agents:
216
+ architect:
217
+ model: "anthropic/claude-sonnet-4-5"
218
+ ```
219
+
220
+ The API-key setup prompt reads only the global `llm.api_key`, so a persona-level `api_key` does not suppress it: when `llm.api_key` is empty the prompt still fires, and validation then reports against the merged key.
221
+
180
222
  ### Environment Variables
181
223
 
182
224
  TeDDy checks the following process environment variables at startup and during a session.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "teddy-cli"
3
- version = "0.2.3.dev1531"
3
+ version = "0.2.3.dev1533"
4
4
  description = "The local-first, test-driven agentic engineering harness. Because you should own the means of development."
5
5
  readme = "README.md"
6
6
  keywords = [
@@ -400,12 +400,19 @@ def update(
400
400
  fetch_latest_version,
401
401
  compare_versions,
402
402
  is_prerelease,
403
- PYPI_URL,
403
+ resolve_index_url,
404
404
  )
405
405
 
406
+ # The check resolves configuration read-only: it never anchors or
407
+ # initializes a project, so a missing `.teddy/config.yaml` falls back to
408
+ # the bundled defaults and the official endpoint.
409
+ container = get_container()
410
+ config_service = _resolve_config_or_exit(container)
411
+ index_url = resolve_index_url(config_service.get_setting("update.index_url"))
412
+
406
413
  # Dev pre-releases are published to PyPI (see .github/workflows/publish.yml),
407
414
  # so --experimental only widens the check to include prereleases.
408
- latest = fetch_latest_version(PYPI_URL, stable_only=not experimental)
415
+ latest = fetch_latest_version(index_url, stable_only=not experimental)
409
416
 
410
417
  if latest is None:
411
418
  typer.echo("Could not check for updates: network error.")
@@ -14,6 +14,10 @@ from teddy_executor.core.ports.inbound.init import IInitUseCase
14
14
  from teddy_executor.core.ports.inbound.run_plan_use_case import IRunPlanUseCase
15
15
  from teddy_executor.core.ports.outbound.session_manager import ISessionManager
16
16
  from teddy_executor.core.ports.outbound.system_environment import ISystemEnvironment
17
+ from teddy_executor.core.domain.models.config_schema import (
18
+ resolve_agent_llm_overrides,
19
+ resolve_effective_model,
20
+ )
17
21
  from teddy_executor.core.domain.models.session import SessionOptions
18
22
  from teddy_executor.core.ports.outbound.user_interactor import IUserInteractor
19
23
  from teddy_executor.core.ports.outbound.session_loop_guard import ISessionLoopGuard
@@ -35,6 +39,7 @@ from teddy_executor.core.services.update_checker import (
35
39
  get_current_version,
36
40
  is_prerelease,
37
41
  read_update_cache,
42
+ resolve_index_url,
38
43
  )
39
44
 
40
45
 
@@ -406,17 +411,21 @@ def _update_cache_path() -> Path:
406
411
  return find_project_root() / ".teddy" / ".update_cache.json"
407
412
 
408
413
 
409
- def _start_background_update_check() -> None:
414
+ def _start_background_update_check(container: Container) -> None:
410
415
  """Start the daemon version fetch that fills the cache for the next run.
411
416
 
412
- The fetch never blocks startup and never prints. The startup preamble emits
413
- the notice from the cache this fetch leaves behind.
417
+ The fetch never blocks startup and never prints. The configured source
418
+ resolves before the thread spawns, so the daemon never touches the
419
+ container. The startup preamble emits the notice from the cache this fetch
420
+ leaves behind.
414
421
  """
415
422
  import threading
416
423
 
424
+ config_service = container.resolve(IConfigService)
425
+ index_url = resolve_index_url(config_service.get_setting("update.index_url"))
417
426
  thread = threading.Thread(
418
427
  target=background_check,
419
- args=(_update_cache_path(),),
428
+ args=(_update_cache_path(), index_url),
420
429
  daemon=True,
421
430
  )
422
431
  thread.start()
@@ -800,9 +809,6 @@ def _display_update_notification(container: Container, cache_path: Path) -> list
800
809
  )
801
810
  return ["checks.update"]
802
811
  except Exception:
803
- import logging
804
-
805
- logger = logging.getLogger(__name__)
806
812
  logger.debug("Failed to display update notification", exc_info=True)
807
813
  return []
808
814
 
@@ -823,7 +829,7 @@ def handle_new_session( # noqa: PLR0913
823
829
  max_cost: Optional[float] = None,
824
830
  ):
825
831
  """Logic for the 'start' command."""
826
- _start_background_update_check()
832
+ _start_background_update_check(container)
827
833
 
828
834
  try:
829
835
  # 0. An empty or whitespace-only -m means the flag was omitted: the
@@ -902,13 +908,23 @@ def _echo_config_success(
902
908
  container: The DI container with resolved services.
903
909
  agent: Optional agent name to display.
904
910
  model: Optional model override from CLI. If provided, this takes
905
- precedence over the config file value.
911
+ precedence over the config file value. When omitted, a configured
912
+ ``agents.<persona>.model`` wins over ``llm.model``.
906
913
  """
907
914
  config_service = container.resolve(IConfigService)
908
- if model:
909
- resolved_model = model
910
- else:
911
- resolved_model = config_service.get_setting("llm.model", "unknown")
915
+ persona_model = None
916
+ if agent:
917
+ # Report the same effective model the planner resolves, so the
918
+ # persona's configured model is visible before the first turn.
919
+ overlay = resolve_agent_llm_overrides(
920
+ config_service.get_setting("agents", {}), agent
921
+ )
922
+ persona_model = overlay.get("model")
923
+ # One resolver owns the flag > persona > llm.model order for the banner too,
924
+ # so the display can never drift from the model the planner uses.
925
+ resolved_model = resolve_effective_model(
926
+ model, persona_model, config_service.get_setting("llm.model", "unknown")
927
+ )
912
928
  identity_lines: list[str] = []
913
929
  if agent:
914
930
  identity_lines.append(f"Agent: {canonical_agent_name(agent)}")
@@ -1479,16 +1495,13 @@ def _sync_and_display_session_meta(
1479
1495
  model: Optional[str] = None,
1480
1496
  agent: Optional[str] = None,
1481
1497
  ) -> None:
1482
- """Reads latest turn meta.yaml, syncs config overrides, and clears actual_model.
1498
+ """Reads latest turn meta.yaml, applies the resume --model override, and clears actual_model.
1483
1499
 
1484
1500
  The identity banner reflects the EFFECTIVE agent: the ``-a/--agent`` override
1485
1501
  when one was passed, otherwise the session's persisted ``agent_name``.
1486
1502
  """
1487
- from teddy_executor.core.ports.outbound.config_service import IConfigService
1488
-
1489
1503
  session_manager = container.resolve(ISessionManager)
1490
1504
  repository: ISessionRepository = container.resolve(ISessionRepository)
1491
- config_service: IConfigService = container.resolve(IConfigService)
1492
1505
 
1493
1506
  latest_turn_path = session_manager.get_latest_turn(session_name)
1494
1507
  meta = repository.load_meta(latest_turn_path)
@@ -1502,13 +1515,13 @@ def _sync_and_display_session_meta(
1502
1515
 
1503
1516
  _echo_config_success(container, agent=agent or meta.get("agent_name"), model=model)
1504
1517
 
1505
- # Sync latest turn's meta.yaml with current config model/overrides
1506
- config_model = config_service.get_setting("llm.model", "unknown")
1518
+ # Only an explicit --model writes metadata. A configuration-derived model
1519
+ # must never be stamped into the per-turn record: resolution reads
1520
+ # ``model_override`` and the persona re-resolves every turn, so a stamped
1521
+ # ``model`` would mask the persona in the telemetry display line.
1507
1522
  if model:
1508
1523
  meta["model"] = model
1509
- changed = True
1510
- elif config_model != "unknown" and meta.get("model") != config_model:
1511
- meta["model"] = config_model
1524
+ meta["model_override"] = model
1512
1525
  changed = True
1513
1526
  if changed:
1514
1527
  repository.save_meta(f"{latest_turn_path}/meta.yaml", meta)
@@ -1529,7 +1542,7 @@ def handle_resume_session( # noqa: PLR0913
1529
1542
  max_cost: Optional[float] = None,
1530
1543
  ):
1531
1544
  """Logic for the 'resume' command."""
1532
- _start_background_update_check()
1545
+ _start_background_update_check(container)
1533
1546
 
1534
1547
  try:
1535
1548
  # 1. Shared startup preamble (preflight only; workspace repairs are start-only)
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  import math
3
- from typing import Any, Dict, List, Optional, Protocol
3
+ from typing import Any, Dict, List, Mapping, Optional, Protocol
4
4
  from teddy_executor.core.ports.outbound.config_service import IConfigService
5
5
  from teddy_executor.core.domain.models.exceptions import ConfigurationError
6
6
  from teddy_executor.core.ports.outbound.llm_client import ILlmClient, LlmApiError
@@ -112,11 +112,17 @@ class LiteLLMAdapter(ILlmClient):
112
112
  # Request, retry, and hydration form one linear flow whose branching is
113
113
  # inherent to the provider protocol. Extracting it is outside this change.
114
114
  def get_completion( # noqa: C901
115
- self, messages: List[Dict[str, str]], model: Optional[str] = None, **kwargs: Any
115
+ self,
116
+ messages: List[Dict[str, str]],
117
+ model: Optional[str] = None,
118
+ llm_overrides: Optional[Mapping[str, Any]] = None,
119
+ **kwargs: Any,
116
120
  ) -> Any:
117
121
  """
118
122
  Sends a request to an LLM via litellm and returns the raw response object.
119
123
  Values in the 'llm' section of the config are passed directly to LiteLLM.
124
+ ``llm_overrides`` layers the active persona's settings over that block,
125
+ below the per-call ``model``.
120
126
  """
121
127
  litellm = self._get_litellm()
122
128
 
@@ -129,20 +135,9 @@ class LiteLLMAdapter(ILlmClient):
129
135
  raise ConfigurationError(errors[0])
130
136
  self._validated = True
131
137
 
132
- final_params = self._prepare_completion_params(model, **kwargs)
133
-
134
- # Lazy startup validation: check config on first call only
135
- if not self._validated:
136
- with self._init_lock:
137
- if not self._validated:
138
- from teddy_executor.core.domain.models.exceptions import (
139
- ConfigurationError as _ConfigError,
140
- )
141
-
142
- errors = self.validate_config()
143
- if errors:
144
- raise _ConfigError(errors[0])
145
- self._validated = True
138
+ final_params = self._prepare_completion_params(
139
+ model, llm_overrides=llm_overrides, **kwargs
140
+ )
146
141
 
147
142
  max_attempts_val = final_params.get("max_retries")
148
143
  max_attempts = int(max_attempts_val) if max_attempts_val is not None else 3
@@ -167,9 +162,18 @@ class LiteLLMAdapter(ILlmClient):
167
162
  raise LlmApiError(f"LLM Completion failed: {final_msg}") from last_exception
168
163
 
169
164
  def _prepare_completion_params(
170
- self, model: Optional[str] = None, **kwargs: Any
165
+ self,
166
+ model: Optional[str] = None,
167
+ llm_overrides: Optional[Mapping[str, Any]] = None,
168
+ **kwargs: Any,
171
169
  ) -> Dict[str, Any]:
172
- """Resolves and layers configuration for the completion request."""
170
+ """Resolves and layers configuration for the completion request.
171
+
172
+ Precedence, lowest first: runtime kwargs, the global ``llm`` block, the
173
+ persona overlay, then the per-call model. The overlay replaces a key's
174
+ complete value (one level deep), so a persona ``extra_headers`` mapping
175
+ supersedes the global one wholesale.
176
+ """
173
177
  from typing import cast
174
178
 
175
179
  params = {**kwargs}
@@ -177,6 +181,9 @@ class LiteLLMAdapter(ILlmClient):
177
181
  llm_config = cast(Dict[str, Any], self._config_service.get_setting("llm", {}))
178
182
  params.update(llm_config)
179
183
 
184
+ if llm_overrides:
185
+ params.update(llm_overrides)
186
+
180
187
  # Drop an empty/blank api_key so litellm applies the provider's own
181
188
  # default (e.g. a dummy key for keyless local models). Forwarding "" is
182
189
  # equivalent to a missing key and raises AuthenticationError.
@@ -65,6 +65,11 @@ class ChecksConfig:
65
65
  update: bool = True
66
66
 
67
67
 
68
+ @dataclass(frozen=True)
69
+ class UpdateConfig:
70
+ index_url: str = ""
71
+
72
+
68
73
  @dataclass(frozen=True)
69
74
  class AutoPruningConfig:
70
75
  enabled: bool = True
@@ -93,6 +98,7 @@ class AppConfig:
93
98
  context: ContextConfig = field(default_factory=ContextConfig)
94
99
  research: ResearchConfig = field(default_factory=ResearchConfig)
95
100
  checks: ChecksConfig = field(default_factory=ChecksConfig)
101
+ update: UpdateConfig = field(default_factory=UpdateConfig)
96
102
  auto_pruning: AutoPruningConfig = field(default_factory=AutoPruningConfig)
97
103
  guardrails: GuardrailsConfig = field(default_factory=GuardrailsConfig)
98
104
  editor: str = ""
@@ -224,6 +230,7 @@ _SCHEMA_FIELDS: tuple[_FieldSpec, ...] = (
224
230
  _FieldSpec("checks.prompts", "checks", "prompts", bool),
225
231
  _FieldSpec("checks.templates", "checks", "templates", bool),
226
232
  _FieldSpec("checks.update", "checks", "update", bool),
233
+ _FieldSpec("update.index_url", "update", "index_url", str),
227
234
  _FieldSpec("auto_pruning.enabled", "auto_pruning", "enabled", bool),
228
235
  _FieldSpec(
229
236
  "auto_pruning.turn_context_threshold",
@@ -269,9 +276,93 @@ _DECLARED_KEY_TARGETS: dict[str, tuple[str | None, str]] = {
269
276
  _KNOWN_TOP_LEVEL = frozenset(
270
277
  {spec.group for spec in _SCHEMA_FIELDS if spec.group is not None}
271
278
  | {spec.key for spec in _SCHEMA_FIELDS if spec.group is None}
272
- | {"llm"}
279
+ | {"llm", "agents"}
273
280
  )
274
281
 
282
+ _AGENTS_GROUP = "agents"
283
+
284
+
285
+ def resolve_agent_llm_overrides(agents_block: Any, persona: str) -> dict[str, Any]:
286
+ """Return the per-persona ``llm`` overlay from the ``agents`` block.
287
+
288
+ The overlay is a copy of the persona entry, so a caller can merge it without
289
+ mutating the lazily interpolated merged configuration. Persona matching is
290
+ case-insensitive, mirroring the prompt resolver's casefold stem rule. A blank
291
+ ``model`` is dropped, because an empty model would reach the provider as an
292
+ unresolvable identifier. Any malformed input (a non-mapping block, a
293
+ non-mapping entry) resolves to an empty overlay, so runtime extraction is
294
+ total; ``construct_app_config`` is the raising seam at load time.
295
+ """
296
+ if not isinstance(agents_block, Mapping):
297
+ return {}
298
+ entry: Any = None
299
+ for key, value in agents_block.items():
300
+ if isinstance(key, str) and key.casefold() == persona.casefold():
301
+ entry = value
302
+ break
303
+ if not isinstance(entry, Mapping):
304
+ return {}
305
+ overlay = dict(entry)
306
+ model = overlay.get("model")
307
+ if isinstance(model, str) and not model.strip():
308
+ del overlay["model"]
309
+ return overlay
310
+
311
+
312
+ def resolve_effective_model(
313
+ override: Any, persona_model: Any, global_model: Any
314
+ ) -> str:
315
+ """Resolve the effective model by the slice precedence.
316
+
317
+ The explicit ``--model`` flag override wins, then the persona entry, then the
318
+ global ``llm.model``. A blank or non-string candidate is skipped so an empty
319
+ identifier never propagates to the provider. When every candidate is blank
320
+ the resolver returns an empty string.
321
+ """
322
+ for candidate in (override, persona_model, global_model):
323
+ if isinstance(candidate, str) and candidate.strip():
324
+ return candidate
325
+ return ""
326
+
327
+
328
+ def _validate_agents_block(merged: Mapping[str, Any]) -> None:
329
+ """Reject an unusable ``agents`` block at load time.
330
+
331
+ A non-mapping block, a non-mapping persona entry, and two persona keys that
332
+ differ only in case each raise a ``ConfigurationError`` naming the offending
333
+ key. The duplicate case fails because case-insensitive matching would
334
+ otherwise make the winning entry depend on YAML key order.
335
+ """
336
+ if _AGENTS_GROUP not in merged:
337
+ return
338
+ block = merged[_AGENTS_GROUP]
339
+ if block is None:
340
+ return
341
+ if not isinstance(block, Mapping):
342
+ raise ConfigurationError(
343
+ f"Configuration key '{_AGENTS_GROUP}' expected a mapping of persona "
344
+ f"names, got {block!r}."
345
+ )
346
+ seen: set[str] = set()
347
+ for persona, entry in block.items():
348
+ if not isinstance(persona, str):
349
+ raise ConfigurationError(
350
+ f"Configuration key '{_AGENTS_GROUP}' expected string persona "
351
+ f"names, got {persona!r}."
352
+ )
353
+ folded = persona.casefold()
354
+ if folded in seen:
355
+ raise ConfigurationError(
356
+ f"Configuration key '{_AGENTS_GROUP}' declares the persona "
357
+ f"{persona!r} more than once when ignoring case. Keep one spelling."
358
+ )
359
+ seen.add(folded)
360
+ if not isinstance(entry, Mapping):
361
+ raise ConfigurationError(
362
+ f"Configuration key '{_AGENTS_GROUP}.{persona}' expected a mapping "
363
+ f"of llm settings, got {entry!r}."
364
+ )
365
+
275
366
 
276
367
  def is_declared_key(key: str) -> bool:
277
368
  """Report whether ``key`` is a schema-declared configuration key."""
@@ -338,6 +429,7 @@ def construct_app_config(merged: Mapping[str, Any]) -> AppConfig:
338
429
  Undeclared top-level groups are ignored so future keys stay forward
339
430
  compatible.
340
431
  """
432
+ _validate_agents_block(merged)
341
433
  _log_unknown_keys(merged)
342
434
  group_overrides: dict[str, dict[str, Any]] = {}
343
435
  top_level_overrides: dict[str, Any] = {}
@@ -360,6 +452,7 @@ def construct_app_config(merged: Mapping[str, Any]) -> AppConfig:
360
452
  context=ContextConfig(**group_overrides.get("context", {})),
361
453
  research=ResearchConfig(**group_overrides.get("research", {})),
362
454
  checks=ChecksConfig(**group_overrides.get("checks", {})),
455
+ update=UpdateConfig(**group_overrides.get("update", {})),
363
456
  auto_pruning=AutoPruningConfig(**group_overrides.get("auto_pruning", {})),
364
457
  guardrails=GuardrailsConfig(**group_overrides.get("guardrails", {})),
365
458
  **top_level_overrides,
@@ -8,7 +8,7 @@ class IGetContextUseCase(Protocol):
8
8
  This defines the contract for the primary entry point for gathering project context.
9
9
  """
10
10
 
11
- def get_context( # noqa: PLR0913 - inbound-port seam; additive keyword
11
+ def get_context( # noqa: PLR0913 - inbound-port seam; additive keywords
12
12
  self,
13
13
  context_files: Optional[Dict[str, Sequence[str]]] = None,
14
14
  include_tokens: bool = True,
@@ -18,6 +18,7 @@ class IGetContextUseCase(Protocol):
18
18
  current_turn: Optional[str] = None,
19
19
  system_prompt_tokens: int = 0,
20
20
  session_root: Optional[str] = None,
21
+ model: Optional[str] = None,
21
22
  ) -> ProjectContext:
22
23
  """
23
24
  Gathers all project context information.
@@ -28,6 +29,8 @@ class IGetContextUseCase(Protocol):
28
29
  system_prompt_tokens: Token count of the system prompt (pre-computed).
29
30
  session_root: Optional root of the rendering session, used to gate
30
31
  session-history classification.
32
+ model: Optional effective model used for token counting. Omitted,
33
+ the provider's configured model is used.
31
34
 
32
35
  Returns:
33
36
  ProjectContext: A data object containing the aggregated context.
@@ -1,5 +1,5 @@
1
1
  from abc import ABC, abstractmethod
2
- from typing import Any, Dict, List, Optional
2
+ from typing import Any, Dict, List, Mapping, Optional
3
3
 
4
4
 
5
5
  class LlmApiError(Exception):
@@ -18,6 +18,7 @@ class ILlmClient(ABC):
18
18
  self,
19
19
  messages: List[Dict[str, str]],
20
20
  model: Optional[str] = None,
21
+ llm_overrides: Optional[Mapping[str, Any]] = None,
21
22
  **kwargs: Any,
22
23
  ) -> Any:
23
24
  """
@@ -26,6 +27,8 @@ class ILlmClient(ABC):
26
27
  Args:
27
28
  messages: A list of message dictionaries (role/content).
28
29
  model: Optional identifier for the target model (overrides config).
30
+ llm_overrides: Optional per-persona overlay merged over the global
31
+ ``llm`` block, with ``model`` still applied last.
29
32
  **kwargs: Additional parameters for the LLM provider.
30
33
 
31
34
  Returns:
@@ -55,6 +55,7 @@ class ContextService(IGetContextUseCase):
55
55
  current_turn: Optional[str] = None,
56
56
  system_prompt_tokens: int = 0,
57
57
  session_root: Optional[str] = None,
58
+ model: Optional[str] = None,
58
59
  ) -> ProjectContext:
59
60
  """
60
61
  Gathers all project context information by orchestrating its dependencies.
@@ -113,7 +114,7 @@ class ContextService(IGetContextUseCase):
113
114
  repo_tree, scoped_paths, file_contents, git_status, session_root
114
115
  )
115
116
  content_tokens = (
116
- self._llm_client.get_text_token_count(content) if include_tokens else 0
117
+ self._count_text_tokens(content, model) if include_tokens else 0
117
118
  )
118
119
 
119
120
  return ProjectContext(
@@ -122,7 +123,7 @@ class ContextService(IGetContextUseCase):
122
123
  scoped_paths=scoped_paths,
123
124
  git_status=git_status,
124
125
  items=self._collect_items(
125
- scoped_paths, file_contents, git_status, include_tokens
126
+ scoped_paths, file_contents, git_status, include_tokens, model
126
127
  ),
127
128
  agent_name=agent_name,
128
129
  total_window=total_window,
@@ -277,6 +278,7 @@ class ContextService(IGetContextUseCase):
277
278
  file_contents: Dict[str, Optional[str]],
278
279
  git_status: Optional[str],
279
280
  include_tokens: bool,
281
+ model: Optional[str] = None,
280
282
  ) -> List[ContextItem]:
281
283
  """
282
284
  Orchestrates the assembly of ContextItem metadata DTOs.
@@ -284,7 +286,7 @@ class ContextService(IGetContextUseCase):
284
286
  """
285
287
  parsed_status = self._parse_git_status(git_status)
286
288
  path_to_tokens = self._get_path_to_tokens(
287
- scoped_paths, file_contents, include_tokens
289
+ scoped_paths, file_contents, include_tokens, model
288
290
  )
289
291
 
290
292
  # Deduplication map: path -> ContextItem
@@ -308,11 +310,23 @@ class ContextService(IGetContextUseCase):
308
310
 
309
311
  return list(items_map.values())
310
312
 
313
+ def _count_text_tokens(self, text: str, model: Optional[str]) -> int:
314
+ """Count tokens with the effective model, preserving the no-model shape.
315
+
316
+ A caller without an effective model issues the same single-argument call
317
+ as before, so existing call-argument assertions and side-effect fakes
318
+ that accept only the text stay valid.
319
+ """
320
+ if model:
321
+ return self._llm_client.get_text_token_count(text, model=model)
322
+ return self._llm_client.get_text_token_count(text)
323
+
311
324
  def _get_path_to_tokens(
312
325
  self,
313
326
  scoped_paths: Dict[str, List[str]],
314
327
  file_contents: Dict[str, Optional[str]],
315
328
  include_tokens: bool,
329
+ model: Optional[str] = None,
316
330
  ) -> Dict[str, int]:
317
331
  """Calculates token counts for all unique files in parallel."""
318
332
  if not include_tokens:
@@ -326,7 +340,7 @@ class ContextService(IGetContextUseCase):
326
340
 
327
341
  def get_count(path: str) -> tuple[str, int]:
328
342
  content = file_contents.get(path) or ""
329
- return path, self._llm_client.get_text_token_count(content)
343
+ return path, self._count_text_tokens(content, model)
330
344
 
331
345
  # Parallelize to handle large repositories without stalling the UI.
332
346
  # We use a ThreadPoolExecutor as token counting is often offloaded or involves latency.