Skip to content

fix(runtime): restore OAuth tool execution and transcript visibility - #240

Closed
im10furry wants to merge 703 commits into
developfrom
fix/oauth-tool-transcript
Closed

fix(runtime): restore OAuth tool execution and transcript visibility#240
im10furry wants to merge 703 commits into
developfrom
fix/oauth-tool-transcript

Conversation

@im10furry

Copy link
Copy Markdown
Contributor

Summary

  • Unify first-run setup, /login, and /model around provider connection; Codex OAuth users choose an available runtime model such as Sol or Terra before activation.
  • Add /model access to the same provider connection flow, deduplicate repeated MCP server names in the startup banner, and simplify slash-command selection color.
  • Restore action-capable Codex OAuth dynamic tools, including write-capable Bash and Task, through Kode's existing validation, permission, hook, mutation-receipt, and verification paths.
  • Persist external dynamic tool-use and tool-result messages to the transcript, and render unavailable tools instead of silently omitting them.

Validation

  • bun install --frozen-lockfile
  • bun run typecheck
  • bun run lint
  • CI=true KODE_TEST_CONCURRENCY=3 bun run test (557 files)
  • bun run build
  • git diff --check

im10furry and others added 30 commits July 16, 2026 22:17
Wire best-effort headless run telemetry through print paths, add goal
schedule create/list/transition APIs end-to-end (core, daemon, client,
web Schedules UI), and share CLI schedule parsing with /loop.
Surface daemon JSON error bodies for schedule mutations, lock protocol
schedule envelopes with tests, and polish Schedules UI with once/interval
modes plus clearer empty-session guidance.
Add an in-page session selector and new-session action so operators can
manage goal schedules without relying only on the chat sidebar selection.
Decouple OpenAI provider transport from core logging and static provider
maps via bindAiDebug and local internals. CLI attaches core diagnostics
at boot; mirror tests normalize the remaining intentional core/ai diffs.
…hooks

Move restricted-client compat, proxy runtime, request-status hooks, and
model-error memory into packages/ai with host bindings. Provider modules
no longer need sessionState/config/debugLogger; queryOpenAI still uses
core for orchestration-only concerns.
Skip incomplete/non-object tool JSON instead of running empty-object
calls, accept provider tool_calls missing type=function, reset stop-hook
counters between tool/goal turns, and auto-select a Schedules session.
Move pure OpenAI orchestration helpers (retry, errors, content, system
prompt split, reasoning effort) into @kode/ai internals. Route stream,
model fallback, logError, and cost tracking through bindAiRuntime so
queryOpenAI no longer hard-imports core config/model/log/cost modules.

Fix getReasoningEffort treating numeric low (0) as missing. CLI boots
bind the host implementations; mirror tests document the intentional
queryOpenAI divergence until core llm.ts switches over.
Own message conversion, vision/image helpers, and structural message
types inside @kode/ai. Bind Responses adapters via bindAiAdapterFactory
so queryOpenAI no longer imports ModelAdapterFactory from core.

Drop the @kode/core workspace dependency and lock the boundary with a
package-boundary test. CLI still wires core adapters/config/cost sinks
at boot through the existing bind surface.
Move model capability registry, adapter factory, and OpenAI adapters out
of core into packages/ai with host-agnostic debug/status/error sinks.
Default-bind the in-package factory so queryOpenAI can use Responses API
without a core import or CLI bind. Core keeps historical adapters for its
llm.ts path until callers switch over.
Re-export UnifiedRequestParams and related capability types from the
adapter-owned modelCapabilityTypes module so LLM transport and adapters
use a single source of truth.
MiMo server-side thinking counts against max_completion_tokens; with small
budgets the model often returns empty content (finish=length, only
reasoning_tokens). Disable thinking unless effort is medium/high, and always
when tools are present (incomplete tool_calls under thinking).

Add a live smoke script that loads credentials from OpenCode config and
covers chat, tools, tool-result rounds, stream, and queryOpenAI.
Removed 64 documentation files that should not exist in the repository:
- docs/_archive/ (historical specs)
- docs/product/ (planning docs)
- docs/research/ (analysis docs)
- docs/develop/ + docs/develop-zh/ (design docs)
- docs/ root user guides and references
- AGENT_CONTEXT/, apps/cli internal docs

Only functional READMEs and runtime assets (skills, SDK) retained.
- Add sampling.ts with CreateMessage request handler that routes
  through queryLLM for multi-provider LLM support
- Declare sampling capability in getMcpClientCapabilities() so
  MCP servers know the client supports sampling
- Register/unregister sampling handler in client lifecycle
- Convert between MCP SamplingMessage and internal Anthropic format
- Resolve model from server's modelPreferences hints
- Map stop_reason between internal and MCP spec formats
- Export sampling control APIs (enable/disable/test helpers)
- Update capability tests for sampling enabled/disabled states
@CrazyBoyM CrazyBoyM closed this Aug 17, 2026
@im10furry
im10furry deleted the fix/oauth-tool-transcript branch August 17, 2026 16:55
@CrazyBoyM
CrazyBoyM restored the fix/oauth-tool-transcript branch August 17, 2026 17:02
@CrazyBoyM CrazyBoyM reopened this Aug 17, 2026
@im10furry
im10furry deleted the branch develop August 17, 2026 17:08
@im10furry im10furry closed this Aug 17, 2026
@im10furry
im10furry deleted the fix/oauth-tool-transcript branch August 17, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants