文件历史

18 次代码提交

作者 SHA1 备注 提交日期
tjb-tech 595a9ab3a4 Merge remote-tracking branch 'origin/main' into review/pr-256
# Conflicts:
#	CHANGELOG.md
2026-05-16 13:04:45 +00:00
David Whatley 635d77fad4 fix(openai): omit empty reasoning_content by default (#263)
`reasoning_content` is a non-standard field that some thinking-model
providers (Kimi k2.5 on Anthropic-format) require on every assistant
message with tool calls — even when empty. Other OpenAI-compatible
providers (Cerebras, NVIDIA NIM, OpenAI direct, etc.) reject the field
outright with a 400 ``wrong_api_format`` validation error.

Until now, ``_convert_assistant_message`` unconditionally emitted
``reasoning_content: ''`` for tool-using assistant messages. That hard-
breaks every strict-OpenAI provider on the very first tool turn.

Behaviour change:

- Captured non-empty reasoning is still always replayed.
- The empty-string fallback is now opt-in via
  ``OPENHARNESS_REQUIRE_EMPTY_REASONING_CONTENT=1``.
- Default behaviour matches strict-OpenAI providers, which is the
  larger / standards-compliant population. Kimi-on-Anthropic users
  set the env var in their dotfiles or settings.

Verified end-to-end against Cerebras gpt-oss-120b (previously 100%
failure rate from this field) — zero ``wrong_api_format`` errors.

Tests added: 6 cases covering captured-replay, opt-in matrix
(truthy/falsy values), and the no-tool-calls invariant.
2026-05-16 19:46:00 +08:00
Pat Yang b93b2cfb30 fix(codex): pass reasoning effort separately 2026-05-12 14:34:12 +08:00
Jiabin Tang 225e87f7d7 fix: recover from dangling tool call history (#239) 2026-05-08 18:25:36 +08:00
tjb-tech 380bab4d7b test(api): lock bearer auth for openai-compatible providers 2026-04-28 02:52:36 +00:00
tjb-tech 6ef371f62f fix(api): handle split think tags in stream filter 2026-04-20 09:02:03 +00:00
yl-jiang a2bb51483d fix(api): strip <think>…</think> blocks from OpenAI-compatible streaming responses
Some providers (e.g. DeepSeek, MiniMax) embed chain-of-thought content
inside <think>…</think> tags in delta.content rather than using a dedicated
reasoning_content field.  Without filtering, these internal reasoning blocks
leak into the user-visible output.

Add _strip_think_blocks() which:
- Removes fully-closed <think>…</think> pairs via regex (DOTALL).
- Holds back any unclosed opening tag in a per-stream buffer so cross-chunk
  tags are handled correctly.

Tests: 9 new unit tests in TestStripThinkBlocks covering no-op passthrough,
single/multiple complete blocks, multiline blocks, unclosed tags, and the
cross-chunk scenario.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 14:30:23 +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
tjb-tech 0b5de01587 feat(ohmo): support channel attachments and multimodal gateway messages 2026-04-08 14:16:01 +00:00
tjb-tech 32caf0f381 fix(gateway): improve codex runtime diagnostics 2026-04-08 07:22:08 +00:00
ZackaryW 71ce441aeb fix: Support max_completion_tokens for newer models
Add _token_limit_param_for_model to map max_tokens vs max_completion_tokens for models that require the latter (e.g. gpt-5 and reasoning-model families).
2026-04-06 15:37:37 -07:00
tjb-tech cd52191f6e feat(auth): add provider profiles and subscription clients 2026-04-06 08:47:10 +00:00
tjb-tech 9b7051825f fix(ci): remove unused copilot imports 2026-04-05 04:36:25 +00:00
Merlin Chen 03e8f0884d fix: use Copilot-compatible model instead of Anthropic default for copilot api_format 2026-04-05 00:06:03 +08:00
Merlin Chen 43f2e4988e feat: add GitHub Copilot provider support with OAuth device flow
Implement full Copilot provider integration using GitHub's OAuth
device flow.  The OAuth token is used directly as a Bearer token
(matching OpenCode's approach) — no intermediate token exchange.

Supports both github.com and GitHub Enterprise (data-residency /
self-hosted) deployments.  Enterprise uses copilot-api.<domain>.

New files:
- copilot_auth.py: OAuth device flow, persistence, enterprise URL
- copilot_client.py: wraps OpenAICompatibleClient with Copilot headers

Modified:
- cli.py: oh auth copilot-login/logout with deployment type selection
- provider.py: Copilot detection + auth status with enterprise info
- runtime.py: CopilotClient routing in build_runtime()
- settings.py: resolve_api_key() returns copilot-managed sentinel
- __init__.py: export CopilotClient
- README.md: Copilot provider documentation
- spawn_utils.py, react_launcher.py, app.py: api_format forwarding

Tests: 31 copilot-specific tests (auth + client), all passing.
2026-04-04 23:46:26 +08:00
washi4 d5c888897d feat: add OpenAI-compatible API client (--api-format openai)
Add OpenAICompatibleClient that implements SupportsStreamingMessages,
enabling any provider using the OpenAI /v1/chat/completions format:
DashScope, DeepSeek, GitHub Models, Groq, Ollama, etc.

- New openai_client.py with streaming, tool calling, retry logic
- --api-format openai CLI flag and OPENHARNESS_API_FORMAT env var
- OPENAI_API_KEY fallback in resolve_api_key()
- Provider detection for dashscope/qwen and github models
- Wired through cli → app → runtime → client selection
- 11 unit tests for format conversion functions
- Updated README provider compatibility section
- CHANGELOG entries
2026-04-04 08:39:51 +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