Skip to content

Improve/agent flow - #265

Open
Vect0rM wants to merge 19 commits into
mainfrom
improve/agent-flow
Open

Improve/agent flow#265
Vect0rM wants to merge 19 commits into
mainfrom
improve/agent-flow

Conversation

@Vect0rM

@Vect0rM Vect0rM commented Aug 27, 2026

Copy link
Copy Markdown
Member

Describe Your Changes

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Vect0rM and others added 16 commits August 14, 2026 15:03
…anagement

- Added `getReasoningControls` method to AIEngine and its extensions to report reasoning capabilities based on model configurations.
- Updated the ReasoningToggle component to include a slider for selecting reasoning effort levels, enhancing user interaction.
- Modified general settings to reflect new reasoning budget levels, including 'xhigh' and 'max'.
- Adjusted localization files to support new reasoning effort terminology and descriptions.
- Enhanced the CustomChatTransport to utilize reasoning controls in chat requests, improving model interaction.
…ing level

- Added a conditional class to accentuate the max reasoning level in the heading.
- Updated the slider track to visually differentiate when the max level is selected.
- Introduced a new test to verify the correct styling of the max reasoning level in the UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Incremented the decision index to reflect the addition of a new record, bringing the total to 204.
- Introduced the `LocalServerEndpoint` struct to manage the local API server's configuration, including host, port, and API key.
- Updated the `AppState` to include a reference to the `local_server_endpoint`, allowing agents to route requests through the local API server.
- Refactored the agent's command handling to support both local and cloud-based model interactions, ensuring compatibility with various transport methods.
- Enhanced prompt handling by splitting prompts into system and user messages for better integration with chat transports.
- Added tests to verify the correct functionality of the new endpoint and prompt handling logic.
- Introduced a new reasoning mechanism for agent turns, allowing for a structured thinking phase before tool calls.
- Updated the decision index to reflect the addition of a new record, increasing the total to 207.
- Implemented reasoning tags and budget management in the agent's completion requests, ensuring compatibility with various transport methods.
- Enhanced grammar generation to support reasoning prelude, improving the parsing of tool calls.
- Added tests to verify the functionality of the new reasoning features and their integration within the agent framework.
- Added WebSearchToggle component to manage web search functionality in ChatInput.
- Updated ReasoningToggle to improve styling and interaction feedback.
- Enhanced localization files to include new strings for web search toggle states.
- Added support for audio transcription using the `os.media.transcribe` tool, allowing users to transcribe local audio files.
- Integrated `tauri-plugin-atomic-audio` for improved audio handling and processing.
- Updated Makefile to include additional Rust tests for the new audio plugin.
- Enhanced documentation to reflect new features and usage instructions for audio-related functionalities.
- Adjusted project configurations to support new dependencies and capabilities.
- Updated the catch block in the ThreadDetail component to explicitly return an empty array of type string[], improving type safety and preventing potential runtime errors.
- Introduced new tools for process management, including `os.proc.spawn`, `os.proc.read`, `os.proc.write`, and `os.proc.stop`, allowing for better control over long-running commands and interactive processes.
- Added support for code symbol indexing and searching with `os.code.symbols`, `os.code.find`, and `os.code.refs`, improving code navigation and analysis.
- Updated the agent's state management to handle new process and code indexing functionalities.
- Enhanced the audio transcription capabilities by integrating optional parameters for monitor-only sessions, improving user experience during audio processing.
- Refactored existing components to accommodate new features and ensure type safety across the application.
…eLayout

- Adjusted button positioning in AgentWorkspaceLayout for better alignment with header controls.
- Enhanced VoiceSetupDialog to ensure consistent height for content slots across steps, preventing resizing issues during navigation.
- Updated step descriptions and titles in localization files for clarity and conciseness.
- Improved test coverage for VoiceSetupDialog to validate fixed content and description lengths across different locales.
…GPT integration

- Updated decision index to reflect new records for agent capabilities, including native RAG tools and ChatGPT subscription integration.
- Added new modules for document indexing and retrieval, enabling enhanced agent interactions with external documents.
- Introduced sampling overrides for fine-tuning agent responses, improving control over output characteristics.
- Enhanced grammar definitions to support new document-related tools, ensuring seamless integration into the agent's workflow.
- Improved overall state management to accommodate new features and maintain type safety across the application.
- Introduced `isSubscriptionProvider` to differentiate between subscription-based and key-based providers.
- Updated `isProviderConnected` logic to account for subscription providers, ensuring accurate connection status.
- Modified `CloudConnectionCard` to conditionally render content based on provider type, preventing duplicate connection states.
- Enhanced `CloudPage` to display the subscription card only when the corresponding provider is selected.
- Added Codex logo for the ChatGPT subscription provider to improve visual representation in the UI.
- Updated tests to validate the new subscription handling and rendering logic.

Vect0rM commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

397 files and +48k/−4.7k is past the point where reading the diff tells you much, so I built and ran it instead. Headline: everything the repo's own gates check is green except make test-quality, and the branch no longer merges. The code itself holds up well under the checks below — the open items are mostly hygiene, plus one real gap in a redaction helper.

Verified on improve/agent-flow merged onto current main (073c885)

  • tsc -b — exit 0.
  • yarn lint — 0 errors, 13 warnings. 11 are in files this branch doesn't touch. Of the two that are, ApiStatusIndicators.tsx is new here (react-refresh/only-export-components).
  • Full vitest run — 264 files, 2552 passed, 16 skipped. Baseline on main is 229 / 2221 / 16, so the 36 new test files land clean with nothing else disturbed.
  • make test-extensions — 22 files, 602 passed across llamacpp, llamacpp-upstream, mlx and download.
  • make test-hardening-contracts — 25/25.
  • make test-rust — 778 passed, 3 failed. All three reproduce on main in the same container, so none are this branch's:
    • skill_run_script::tests::{cancellation,timeout}_terminates_descendant_processes — fail on main too.
    • contract_tests::filesystem_trash_moves_directories_through_the_native_trash_api — asserts the native trash API does not create ~/.local/share/Trash/files, which on Linux it legitimately does. It's self-skipping when that directory already exists, so it passes on a second run and fails on a clean one. I confirmed on main with the directory removed: same failure. Worth an explicit #[cfg(not(target_os = "linux"))] rather than leaving it order-dependent, but that's a separate change.

Two environment notes for anyone reproducing this on Linux: the build now needs libasound2-dev (see item 6), and core has to be built and packed before the web tests resolve @janhq/core.

Blockers

1. Merge conflict against main

One file, one line — docs/decisions/INDEX.md:

<<<<<<< HEAD
216 records, 2026-05-19 → 2026-08-25.
=======
227 records, 2026-05-19 → 2026-08-27.
>>>>>>> improve/agent-flow

Taking either side is wrong. The merged tree has 228 record files, and this branch's index is missing a row for 2026-08-25-add-atomic-agent-as-a-one-click-launch-page-assistant.md, which arrived on main via #258. The index is hand-maintained, so it needs regenerating against the merged set rather than a pick.

2. make test-quality is red, and two of the three entries are new here

- [call-only-assertions] web-app/src/containers/__tests__/ThreadList.test.tsx
- [call-only-assertions] web-app/src/hooks/__tests__/useThreads.test.ts
- [call-only-assertions] web-app/src/lib/ensure-embeddings.test.ts

ThreadList.test.tsx is pre-existing — it flags on main too, and this branch doesn't touch it. The other two are yours:

  • useThreads.test.tscleans up the vector collection with the bare thread id and clears per-thread agent state on bulk deletes assert only toHaveBeenCalledWith.
  • ensure-embeddings.test.tswarms up once and memoizes success and shares one in-flight warm-up between concurrent sends assert only toHaveBeenCalledTimes.

For the memoization and dedup cases the call count genuinely is the observable behaviour, so allowlisting looks right rather than contorting the assertions. You already extended tests/test-quality-allowlist.json by 13 entries in this branch; these two were missed. Adding them takes the gate from 3 entries to 1, and the remaining one is main's problem.

Worth deciding either way, because test-quality sits inside make verify-fast, so it gates every agent-authored change behind it.

3. maskSensitiveUrl misses the two places an MCP secret actually lives

web-app/src/lib/mask-sensitive-url.ts, rendered at ConnectedServerCard.tsx:108. The query-parameter path works. Running the function over the shapes an MCP server URL actually takes:

"https://user:s3cr3t@mcp.example.com/sse"       -> "https://user:s3cr3t@mcp.example.com/sse"
"https://mcp.example.com/sse?api_key=abc123"    -> "https://mcp.example.com/sse?api_key=******"
"https://mcp.example.com/sse#token=abc123"      -> "https://mcp.example.com/sse#token=abc123"

Basic-auth userinfo is one of the most common ways a hosted MCP endpoint carries a credential, and URL.toString() preserves it verbatim — so the card displays the password in full, which is the one thing this helper exists to prevent. The fragment has the same gap. Both are a couple of lines:

if (urlObj.password) urlObj.password = '******'
if (urlObj.username) urlObj.username = '******'

Two smaller things in the same function: ?key=a&key=b collapses to a single key=****** because params.set drops duplicates (harmless — it masks more, not less), and a token carried in the path (/sse/tok_live_…, which several hosted servers use) isn't reachable by any query-param rule. The path case may be out of scope; the userinfo one isn't.

The file has no test. Given what it's for, it should — the three lines above are most of the fixture.

Should fix before merge

4. The description is the untouched template

## Describe Your Changes is a bare -, and both Closes # lines are empty. For a change this size — carrying five new ADRs, a new OAuth provider, a new audio plugin, PTY-backed process tools and a code index — the description is what ends up in the merge commit and in git log for everyone afterwards. The ADRs are excellent and do the hard part; the description mostly needs to point at them and say what a user gets.

5. release: v2.0.24 is in the feature branch

9d8069a bumps web-app/package.json and src-tauri/tauri.conf.json. Every other version bump in this repo is its own commit on main (9097a05, 3b625ff), and carrying it here means the branch's mergeability is tied to whenever the next release is actually cut. Cleaner dropped from the branch and done separately after this lands.

Nits

  1. libasound2-dev is a new build prerequisite on Linux. cpal/alsa/alsa-sys are new in Cargo.lock, and without the headers cargo fails at alsa-sys's build script rather than anywhere informative. You already added it to release.yml, which is the part that matters — but nothing tells a contributor building locally, and DEVELOP.md has no prerequisites section to put it in.

  2. Prettier. 52 of the 111 new web-app source files come up unformatted, plus 5 modified files that are clean on main (NavMain.tsx, DeleteAllThreadsDialog.tsx, SettingsMenu.test.tsx, custom-chat-transport.harness.test.ts, settings/providers/__tests__/index.test.tsx). Nothing enforces this — .husky/pre-commit runs yarn lint --fix only — so it's cosmetic, but 52 files is enough drift to be worth one prettier --write pass over the added files.

  3. os.code.symbols / os.code.refs aren't path-aware. Both resolve a path in prepare_call_paths, but neither is in is_path_aware_filesystem_tool, so an out-of-root path gets escaped_root and a per-call approval with no FolderAccessRequest — the user can approve once but never connect the folder. os.media.transcribe was added to that list in the same diff, so the omission reads like an oversight rather than a decision. Not a safety hole (the stricter path is the one taken), just a dead end for the user.

  4. resolveThreadExecutionRoute(_threadId, turn) ignores its first argument. The underlying resolveMessageExecutionRoute is well covered in agent-route.test.ts, so this is only the store-reading adapter — but a function that takes a thread id and routes globally will mislead the next caller who assumes per-thread routing works.

  5. agent-workspace-actions.ts has no test. It's 26 lines, but it's the entry point that grants canEdit: true on a folder the user picks, i.e. the thing that widens the agent's editable roots. A test pinning that grant is cheap insurance.


Nothing above is structural. The parts I looked at closely are careful work: every unwrap() in pty.rs and openai_client.rs is inside a #[cfg(test)] module, store.rs sets 0o600 on OpenOptions rather than chmod-after-create, no token crosses the IPC boundary, the connector secret input is type="password", and the new capability grant is a single atomic-audio:default line. The ChatGPT ADR recording the client-id decision before any code was written is exactly the right way to have handled that one 🚀


Generated by Claude Code

- Enhanced `DropdownModelProvider` to conditionally display providers based on connection status, ensuring only active and ready providers are shown.
- Updated `ChatInput` to maintain agent controls when no provider is resolved, improving user experience during initial loads.
- Introduced `DEFAULT_REASONING_LEVELS` to keep reasoning options visible when no model is selected, preventing loss of user settings.
- Refactored `useModelProvider` to re-enable cloud providers that were previously disabled, ensuring they appear in the model picker after connection.
- Improved tests for `ChatInput` and `ReasoningToggle` to validate new behaviors and ensure consistent functionality across scenarios.
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.

1 participant