Improve agent tracing, exec tooling, and tool-card stability#1180
Merged
Conversation
- add structured model exchange tracing modes under app logging config - support full and usage-only trace capture policies - skip request body capture when usage-only tracing is enabled - allow response trace fields to be omitted based on trace policy - persist capture mode in model exchange trace records
…cancelled Root cause: single-round stream retry logic only checked cancellation before/after parts of the request flow, but not while awaiting send_message_stream or retry backoff sleep. When the API was unreachable, a cancelled dialog turn could remain stuck inside request open / retry wait and continue retrying until the 10-attempt budget was exhausted. Fix: wrap send_message_stream with cancellation-aware select logic so request opening can exit immediately on cancel, and replace retry backoff waits with cancellable sleep. Add focused tests to verify retry sleep returns promptly when the cancellation token fires.
Add request trace usage CSV exporter under scripts/request-trace-tools Add standalone usage dashboard for visualizing request token trends Support prompt/completion/cache hit/cache miss/cache write analysis
A regression was introduced by 05be491 ("feat(miniapp): add PPT Live built-in app with agent bridge and deck export"), which started replacing collapsed tool stubs with expanded schemas after GetToolSpec unlocks. That behavior changed the request prefix across turns and caused provider-side prefix/KV cache misses. This change restores stable prompt-visible tool definitions by: - keeping collapsed stubs unchanged after GetToolSpec unlocks - relaxing collapsed stubs with `additionalProperties: true` so unlocked tools remain callable without schema rewrites - keeping Task prompt-visible even when fresh subagents are temporarily unavailable, avoiding additional turn-to-turn manifest drift Also add comments documenting when tool-definition changes are expected and why other mid-session drift should be avoided.
- add model exchange tracing support to aggregated ai-adapter requests - trace auto and manual context compression model calls as operations - replace round-specific trace metadata with operation metadata - update request trace CSV/dashboard tools for the new trace shape
- remove ExecCommand/WriteStdin/ExecControl max_output_chars tool input - let exec runtimes return unbounded output and rely on tool-result persistence - set default yield_time_ms to 30s for ExecCommand and WriteStdin - keep ExecControl default yield_time_ms at 10s - exempt WriteStdin from identical-call loop blocking for polling flows - add Windows runtime guidance that ExecControl interrupt matches kill for local non-TTY exec sessions
Drop the dead persist_btw_turn helpers from coordinator and session manager. This keeps /btw aligned with its EphemeralChild design and avoids accidental reintroduction of persisted side-thread turns.
- Add ExecControl card model and renderer wiring - Show interrupt/kill session state with localized copy - Treat ExecControl progress as terminal-like output - Cover ExecControl model behavior with focused tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves agent runtime observability and tool execution behavior across the core runtime, adapters, and Web UI. It adds request trace usage analysis tools, expands model exchange tracing for context compression calls, stabilizes prompt-visible tool definitions across turns, and improves exec command/control handling.
It also adds a dedicated Web UI card for
ExecControl, refines ask-user-question contract defaults, removes dead/btwpersistence helpers, and fixes cancellation so round stream retries stop promptly when a dialog turn is cancelled.Changes
ask_user_question.multiSelectoptional with defaultfalsemax_output_charsfrom ExecCommand/WriteStdin/ExecControl inputsyield_time_msvalues/btwpersistence helpers from coordinator/session managerVerification
cargo check --workspacepnpm run type-check:webpnpm --dir src/web-ui run test:run src/flow_chat/tool-cards/execProcessToolCardModel.test.tspnpm run i18n:audit