Commit graph

5 commits

Author SHA1 Message Date
Alessandro
60c940fd03 fix(model-config): detect Claude models across providers
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
The Anthropic thoughts-prompt hook previously activated only when the
provider or model name contained "anthropic". Claude models exposed by
third-party or OpenAI-compatible providers without that identifier
therefore missed the prompt adaptation.

Extend the existing detection with a case-insensitive "claude" match
in the effective main model name, regardless of provider. Preserve the
existing "anthropic" match in either the provider or model name.

Keep the public-action-summary substitutions and prompt scope unchanged.
Preserve shared prompt templates, the thoughts JSON field, saved history,
custom wording, and native protocol projection. Do not change transport
error handling or suppress provider content-policy errors.

Add regression coverage for Claude-only model names across OpenRouter,
OpenAI-compatible, Vertex AI, Bedrock, and generic providers, plus mixed
case and negative cases. Update the plugin contract and README.

Validation:
- Reproduced five failing Claude-only cases before the fix.
- Passed 99 targeted prompt, model-config, and onboarding tests using
  /opt/venv-a0/bin/python.
- Passed git diff --check.

Live A0 API/provider behavior was not retested; this fixes the detection
gap but does not establish that every provider refusal is resolved.
2026-09-30 19:03:54 +02:00
Alessandro
325d3a982d Adapt thoughts instructions only for Anthropic models
Add a model-config Agent.read_prompt extension that adjusts two bundled
thoughts instructions when the effective main provider or model name
contains anthropic, case-insensitively. This also covers Anthropic models
routed through OpenRouter and named Bedrock endpoints.

Request public action summaries while preserving the thoughts JSON field,
shared prompt files, saved history, custom wording, and other models.
Apply the same adjustment to standalone communication reads so native
protocol projection continues to match the rendered main prompt.

Add regression coverage for provider matching, unaffected models and
custom text, and native prompt projection. Document the scoped behavior.

Validation: 125 focused tests passed across this and the refusal-handling
change. Live Opus 5.5 WebUI checks using the Anthropic API preset completed
a greeting and a terminal calculation with visible thoughts and valid
tool JSON. OpenRouter routing was verified by unit tests.
2026-09-23 15:19:25 +02:00
Alessandro
51f3ed00a1 Add project extension data hooks
Introduce generic project edit-data extension hooks so plugins can contribute named project settings sections without coupling helpers.projects to plugin-specific storage.

Move _model_config project LLM payload handling behind those hooks and preserve inherited global model settings unless a project override already exists or is explicitly selected.

Cover the inheritance regression, existing scoped overrides, multiple plugin sections, core-field collision protection, and extension payload filtering in focused project/model-config tests.
2026-06-23 07:34:21 +02:00
Alessandro
5f235f73f6 model_config: decouple browser agent model wiring
Move the browser model instantiation logic out of `_model_config` and into `_browser_agent` to properly invert the dependency direction.

This prevents the always-enabled `_model_config` plugin from taking a hard dependency on the optional `_browser_agent` module, ensuring it won't break if the browser module is removed or replaced.
2026-03-24 18:09:48 +01:00
frdel
7e1d9ad2a4 refactor: migrate extension system to use deep directory paths based on module and qualname
- Change @extensible decorator to generate extension paths from full module and qualname hierarchies instead of flattened names
- Update extension path format from `{module}_{qualname}_{start|end}` to `_functions/<module>/<qualname>/{start|end}`
- Move all extension files to new deep directory structure under `_functions/` to match new path format
- Replace PathSpec.from_lines(GitWildMatchPattern, ...) with PathSpec.from_lines
2026-03-22 21:48:01 +01:00