文件历史

提交图

24 次代码提交

作者 SHA1 备注 提交日期
Siaochuan 63ac368975 fix(auth): prefer scoped provider env keys
Prefer OPENHARNESS_<PROVIDER>_API_KEY variables over provider-native globals while resolving API-key auth. Keep provider-native variables as fallback and avoid applying unrelated native keys across active profiles.

Forward the OpenHarness-scoped auth/provider environment variables to spawned teammates.

Based-on: #93
2026-05-24 09:05:44 +00:00
tjb-tech c281d34c4a fix(swarm): inherit OpenHarness permission config
Forward OpenHarness config/data env vars to spawned teammates and apply CLI permission_mode overrides to Settings.permission.mode so full_auto survives sub-agent startup paths.

Fixes #274
2026-05-24 08:18:20 +00:00
tjb-tech 4ba71f2d4a fix(telegram): use configured bot identity
Remove the hard-coded nanobot name from Telegram /start and /help responses and sanitize dangling tool-use turns before continue_pending resumes a session.
2026-05-16 12:45:08 +00:00
d 🔹 a75053a740 fix(channels): declare reply_to_message field on TelegramConfig
`TelegramChannel.send` reads `self.config.reply_to_message` in the
outbound path, but the field was never declared on `TelegramConfig` —
only `ohmo init` (interactive mode) wrote it as a free-form key into
gateway.json. Configs that do not go through the interactive prompt —
`ohmo init --no-interactive`, pre-0.1.9 hand-written gateway.json, the
docs example — never have the key set, so every outbound message
crashes with `AttributeError: 'TelegramConfig' object has no attribute
'reply_to_message'` and the bot appears completely silent to the user.

Add `reply_to_message: bool = True` to `TelegramConfig` so the attribute
always exists. The default matches the interactive `ohmo init` default
(`default=bool(prior.get("reply_to_message", True))` in `ohmo/cli.py`),
so non-interactive and interactive configs that accept defaults behave
identically.

Same shape as #192 (proxy field), which added a missing `TelegramConfig`
attribute the implementation already assumed.

Closes #243

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 03:39:34 +08:00
tjb-tech d2489758f0 fix(config): add NVIDIA NIM provider profile
Add a built-in NVIDIA NIM OpenAI-compatible workflow that reads NVIDIA_API_KEY, document the backend, and cover auth/profile materialization. Also make Windows shell resolution skip discovered bash executables that cannot run commands, and update the macOS Terminal backspace troubleshooting note to reflect the current fix.
2026-05-06 11:06:35 +00:00
Mcy0618 e536394812 feat(provider): add ModelScope inference API support (#224)
* feat(provider): add ModelScope inference API support

* fix(cli/auth): wire ModelScope into CLI and auth manager
2026-05-02 22:07:45 +08:00
hzb be66e015bf feat(providers): add Qwen (DashScope) to default provider profiles
Add qwen profile to default_provider_profiles() with dashscope provider.
Uses OpenAI-compatible API format at dashscope.aliyuncs.com with
qwen-plus as the default model and DASHSCOPE_API_KEY for auth.

The ProviderSpec for dashscope already existed in registry.py but lacked
a ProviderProfile, making it unavailable via 'oh provider list/use'.
2026-04-28 10:19:39 +08:00
Octopus c0d3de2f95 feat(provider): add MiniMax as a first-class provider (#140)
- Add built-in `minimax` profile to `default_provider_profiles()` with
  `MiniMax-M2.7` as default model and `https://api.minimax.io/v1` base URL
- Add `minimax_api_key` / `MINIMAX_API_KEY` auth source support to
  `auth_source_provider_name()`, `default_auth_source_for_provider()`,
  and `resolve_auth()` env-var lookup
- Add MiniMax to `_KNOWN_PROVIDERS`, `_AUTH_SOURCES`, `_PROFILE_BY_PROVIDER`,
  and auth-status check in `AuthManager`
- Add `minimax` and `minimax_api_key` to CLI provider/auth-source label maps
  and `oh auth login` provider list; update default model for
  `minimax-anthropic` interactive flow from `minimax-m1` to `MiniMax-M2.7`
- Add `MiniMax-M2.7` / `MiniMax-M2.7-highspeed` model suggestions to the
  React UI model picker
- Add unit tests for MiniMax profile, auth-source mapping, env-var resolution,
  and profile materialisation

Co-authored-by: octo-patch <octo-patch@github.com>
2026-04-16 14:38:07 +08:00
tjb-tech d38796518a Merge branch 'pr-141' into integrate-pr141
# Conflicts:
#	CHANGELOG.md
#	frontend/terminal/src/App.tsx
#	frontend/terminal/src/components/ConversationView.tsx
#	frontend/terminal/src/components/ToolCallDisplay.tsx
#	frontend/terminal/src/hooks/useBackendSession.ts
2026-04-14 12:07:30 +00:00
siaochuan 7d2a0104ba feat(tui): add codex output style to reduce streaming flicker 2026-04-14 19:18:20 +08:00
tjb-tech 39ffc199a8 fix(config): resolve compact thresholds and base URL regressions 2026-04-12 15:33:43 +00:00
tjb-tech 327c6ed2ff fix(ui,openai): reduce TUI flicker and make timeout configurable 2026-04-11 14:31:19 +00:00
jiakeboge a3f1b23fb6 fix(config): strip ANSI escape sequences from model names
When setting ANTHROPIC_MODEL or OPENHARNESS_MODEL environment variables
in terminals with formatting (e.g., bold text), ANSI escape sequences like
\x1b[1m can be inadvertently included in the model name. This causes the
API to receive an invalid model name like 'claude-opus-4-6[1m]' instead of
'claude-opus-4-6', resulting in a 404 error.

Changes:
- Add strip_ansi_escape_sequences() helper function
- Apply stripping in _apply_env_overrides() for env vars
- Apply stripping in merge_cli_overrides() for CLI args
- Add comprehensive tests for ANSI escape handling

Fixes #113
2026-04-11 17:22:19 +08:00
tjb-tech 32caf0f381 fix(gateway): improve codex runtime diagnostics 2026-04-08 07:22:08 +00:00
tjb-tech dfaa4b26f7 Merge PR #52: support OPENAI_BASE_URL in env overrides; fix resolve_auth key priority
- Add OPENAI_BASE_URL to env override chain
- Fix resolve_auth() to check provider-specific env var before flat api_key
- Infer provider=openai when api_format=openai
- Prefix bare version models (e.g. '5.4' -> 'gpt-5.4') for OpenAI providers
- Fix 4 pre-existing test env var leaks
- Preserved main's credential_slot logic while adopting new env-var-first priority

Co-authored-by: siaochuan <siaochuan@users.noreply.github.com>
2026-04-07 12:07:57 +00:00
solon 37f66f48fe fix(auth): support OPENAI_BASE_URL in env overrides and fix test env leaks
Root cause: _apply_env_overrides() only checked ANTHROPIC_BASE_URL and
OPENHARNESS_BASE_URL, ignoring OPENAI_BASE_URL. Users with OpenAI-compatible
relay services (e.g. relay.nf.video) that set OPENAI_BASE_URL had their
base_url left as None in settings, sending requests to api.openai.com
instead of their relay — causing 401 errors.

Fix:
- Add OPENAI_BASE_URL to the env override chain (after ANTHROPIC_BASE_URL,
  before OPENHARNESS_BASE_URL) so relay base URLs are explicitly captured
  in settings rather than relying solely on the OpenAI SDK's env var
  detection.
- Fix 4 pre-existing test failures caused by OPENAI_API_KEY / ANTHROPIC_*
  env vars leaking into test assertions. Tests now use monkeypatch to
  isolate from the host environment.
- Add tests for OPENAI_BASE_URL pickup and ANTHROPIC_BASE_URL precedence.
2026-04-07 14:49:48 +08:00
solon 06c3ed2d03 fix(auth): resolve_auth() sends wrong API key when switching providers
When a user has an Anthropic API key stored in settings.json and
switches to --api-format openai, resolve_auth() blindly returned the
flat self.api_key (Anthropic key) before checking provider-specific
environment variables. This sent the wrong credential to the OpenAI
endpoint, causing 401 errors.

Fix: check the auth_source-specific environment variable (e.g.
OPENAI_API_KEY) before falling back to the flat api_key field.
This ensures the correct credential is used when multiple providers
are configured.
2026-04-07 13:58:45 +08:00
tjb-tech 3558ae6e57 feat(cli): streamline provider setup flows 2026-04-06 13:29:46 +00:00
tjb-tech cd52191f6e feat(auth): add provider profiles and subscription clients 2026-04-06 08:47:10 +00:00
tjb-tech d26c626111 refactor: move maintainer skills (harness-eval, pr-merge) to .claude/skills/
These are developer/maintainer workflow skills, not user-facing bundled
skills. They belong in .claude/skills/ (project-local, not packaged).
2026-04-05 06:51:24 +00:00
tjb-tech 9ba812d197 feat(config): raise default max turns to 200 2026-04-05 06:07:06 +00:00
solon 734833f2fd chore: raise default max_turns from 8 to 32
8 turns is too conservative for most agentic workflows — tool-heavy
tasks routinely need 20+ turns. 32 gives reasonable headroom while
still preventing runaway loops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 07:16:05 +08:00
solon f96d5e3690 Handle max_turns exhaustion and allow /continue 2026-04-04 19:51:43 +08:00
tjb-tech 5dd8b952ec Initial release: oh — OpenHarness: Open Agent Harness v0.1.0
A lightweight open-source Python implementation of the Agent Harness architecture.
44x lighter than Claude Code (11K vs 512K lines), 98% core tool coverage.

- 43 tools with Pydantic validation and parallel execution
- Skills system compatible with anthropics/skills (17+ tested)
- Plugin system compatible with claude-code/plugins (12+ tested)
- API retry with exponential backoff
- Multi-level permissions with path rules
- React/Ink TUI with "Oh my Harness!" branding
- 114 unit tests + 6 E2E test suites
- MIT License
2026-04-01 16:32:25 +00:00