Skip to content

fix(agents): propagate runtime context windows, maxTokens, and image modality across harnesses - #443

Open
trukhinyuri wants to merge 2 commits into
router-for-me:devfrom
trukhinyuri:fix/agent-runtime-model-metadata
Open

trukhinyuri wants to merge 2 commits into
router-for-me:devfrom
trukhinyuri:fix/agent-runtime-model-metadata

Conversation

@trukhinyuri

@trukhinyuri trukhinyuri commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Apply configured context limits before merge_runtime_context_windows in fetch_codex_runtime_models.
  • Extend CodexRuntimeModel and merge_runtime_context_windows to propagate input_modalities and max_tokens (harness_metadata.maxTokens) alongside context_window.
  • Enable runtime metadata merging for Hermes, OpenClaw, OpenCode, ClaudeCode, and ClaudeDesktop, and write limit.context/limit.output in OpenCode, max_output_size/image_in in Kimi Code, and maxOutputTokens in VSCode Copilot.
  • Add gemini-4-argon-{low,medium,high} (1,048,576) to claude_models/model-catalog.json and support macOS bundle/CLI path discovery for WorkBuddy, OpenClaw, Kimi Code, Grok Build, and OpenCode.

Verification

  • cargo test --manifest-path src-tauri/Cargo.toml

Copilot AI balanced review requested due to automatic review settings October 15, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Metadata propagation still has precedence and reconfiguration gaps, and an existing test assertion conflicts with the new behavior.

4 open findings
What changed in this PR

Extends runtime model metadata propagation across agent integrations and improves application discovery.

Changes:

  • Propagates context limits, output-token limits, and image capabilities to additional harnesses.
  • Adds Gemini Argon catalog defaults and macOS/CLI discovery paths.
  • Updates regression coverage and cross-platform test cleanup.
File Description
src-tauri/​src/​tests/​agent_configuration.rs Tests runtime metadata propagation.
src-tauri/​src/​codex_catalog/​customizations.rs Updates the runtime model fixture.
src-tauri/​src/​codex_catalog.rs Parses and merges additional runtime metadata.
src-tauri/​src/​agents/​workbuddy.rs Isolates macOS discovery during tests.
src-tauri/​src/​agents/​discovery.rs Expands executable paths and macOS version-reading support.
src-tauri/​src/​agents/​deepseek_desktop.rs Adds macOS bundle and version discovery.
src-tauri/​src/​agents/​copilot.rs Applies runtime metadata and output limits.
src-tauri/​src/​agents/​configuration.rs Writes OpenCode limits and Kimi capabilities.
src-tauri/​src/​agents/​commands.rs Expands runtime enrichment and applies configured limits.
src-tauri/​src/​agents/​backups/​tests.rs Makes symlink cleanup cross-platform.
src-tauri/​resources/​claude_models/​model-catalog.json Adds Gemini Argon context defaults.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src-tauri/src/agents/commands.rs Outdated
Comment thread src-tauri/src/agents/configuration.rs
Comment thread src-tauri/src/agents/configuration.rs Outdated
Comment thread src-tauri/src/codex_catalog.rs
@trukhinyuri
trukhinyuri force-pushed the fix/agent-runtime-model-metadata branch from 593cfbb to 4465bf8 Compare October 15, 2026 00:46
@trukhinyuri
trukhinyuri requested a balanced review from Copilot October 15, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src-tauri/src/agents/commands.rs Outdated
Comment thread src-tauri/src/agents/configuration.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cross-harness compatibility and macOS discovery require integration validation before final human approval.

0 open findings

2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Handle macOS app bundle paths in version detection

src-tauri/​src/​agents/​deepseek_desktop.rs:80

Manual macOS .app overrides are accepted by manual_desktop_path and passed unchanged here by inspect_agent_config_with_executables. For a bundle path, parent()?.parent()? resolves outside the bundle, so version detection misses an existing Contents/Resources/app.asar. Handle bundle paths separately from discovered Contents/MacOS executables.

🧠 Review effort: Balanced

@trukhinyuri

Copy link
Copy Markdown
Contributor Author

Addressed the "Handle macOS app bundle paths in version detection" finding (src-tauri/src/agents/deepseek_desktop.rs:80) in 598f5c5: when a manual desktop override points at a .app bundle directory, the version is now read from <bundle>/Contents/Resources/app.asar; executables under Contents/MacOS keep the existing lookup. Added deepseek_desktop_macos_version_reads_bundle_and_executable_paths covering both path forms and a bundle without app.asar. cargo test: 858 passed, 0 failed.

@lzt404
lzt404 force-pushed the dev branch 2 times, most recently from 1c13fe0 to 3ee2314 Compare October 19, 2026 05:15
shiranzby added a commit to shiranzby/EasyCLIProxyAPI that referenced this pull request Oct 20, 2026
The agent model picker read /v1/models without `client_version`, so the kernel
answered with the bare `{id,object,owned_by}` list. Nothing carried
`input_modalities` or `context_window`, so WorkBuddy's config writer had no value
for `supportsImages` - and the client gates image input on
`supportsImages === true`, meaning every model looked text-only.

- also fetch the catalog variant (`client_version=cpa`) and graft its capability
  fields onto the bare listing, so config.yaml aliases and custom model IDs stay
  in the picker
- parse `slug`, the key the catalog uses for a model name
- default WorkBuddy's `supportsImages` to true when the catalog has no entry, so
  hand-typed custom IDs are not silently text-only

Upstream reports the same gap as router-for-me#442; its fix
(router-for-me#443) is still open.
@trukhinyuri
trukhinyuri force-pushed the fix/agent-runtime-model-metadata branch from 598f5c5 to 5379376 Compare October 26, 2026 19:43
@trukhinyuri

Copy link
Copy Markdown
Contributor Author

Rebased onto current dev. I dropped two parts that dev now covers: the client_version=cpa request (b80ee99 pins the Codex version) and the macOS DeepSeek Harness bundle fix (#485). The rest is unchanged, and I updated the description to match.

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.

2 participants