feat(typing): add configurable typingTtlSeconds option#6778
feat(typing): add configurable typingTtlSeconds option#6778rahultappetla wants to merge 2 commits into
Conversation
Additional Comments (1)
The examples use a top-level Prompt To Fix With AIThis is a comment left during a code review.
Path: docs/concepts/typing-indicators.md
Line: 40:47
Comment:
[P1] Docs config key doesn't match actual schema
The examples use a top-level `agent` key, but the config types/schema use `agents.defaults` (agent-level) and `session` (session-level). As written, users who copy/paste the example will configure a key that the loader likely ignores. Consider updating the snippet to `agents: { defaults: { ... } }` (or whatever the repo’s canonical config shape is) to avoid confusion.
How can I resolve this? If you propose a fix, please make it concise. |
d5130c9 to
3600e92
Compare
Add a new configuration option `typingTtlSeconds` to control the maximum
duration the typing indicator stays active before auto-stopping.
## Problem
The typing indicator TTL was hardcoded to 2 minutes. For long-running
LLM operations (complex tool chains, slow model responses, rate limit
fallbacks), the indicator would stop prematurely, making the bot appear
unresponsive even though it was still processing.
## Solution
Add `typingTtlSeconds` as a configurable option in both agent defaults
and session config, following the same pattern as `typingIntervalSeconds`.
- Default remains 120 seconds (2 minutes) for backward compatibility
- Configurable at agent level (`agents.defaults.typingTtlSeconds`)
- Overridable per session (`session.typingTtlSeconds`)
- Agent config takes priority over session config
## Changes
- `zod-schema.agent-defaults.ts`: Add schema validation
- `zod-schema.session.ts`: Add schema validation
- `types.agent-defaults.ts`: Add TypeScript type
- `types.base.ts`: Add TypeScript type
- `get-reply.ts`: Wire config to typing controller
- `typing.test.ts`: Add test coverage for TTL behavior
- `docs/concepts/typing-indicators.md`: Document the new option
## Usage
```json5
{
agents: {
defaults: {
typingTtlSeconds: 300, // 5 minutes
},
},
}
```
3600e92 to
22836ee
Compare
|
Addressed Greptile Feedback P1 - Docs config key mismatch: Fixed the examples in docs/concepts/typing-indicators.md to use the correct config structure (agents: { defaults: { ... } } instead of agent: { ... }). This was a pre-existing issue in the docs, P2 - Fragile test assertions: Updated the TTL tests to use isActive() checks and verify that call counts stop increasing after TTL, rather than asserting exact call counts which could be sensitive to timer ordering. |
bfc1ccb to
f92900f
Compare
This comment was marked as spam.
This comment was marked as spam.
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Problem
The typing indicator TTL is currently hardcoded to 2 minutes (120 seconds). For long-running LLM operations—such as complex tool chains, slow model responses, or rate limit fallbacks—the typing indicator stops prematurely,
making the bot appear unresponsive even though it's still actively processing.
Real-world scenario: When using model fallback chains (e.g., primary → backup → CLI), a single request can take 5-10+ minutes. Users see the typing indicator stop after 2 minutes and assume the bot has crashed.
Solution
Add
typingTtlSecondsas a configurable option in both agent defaults and session config, following the exact pattern established bytypingIntervalSeconds.Key points:
agents.defaults.typingTtlSecondssession.typingTtlSecondsRelated Issues
This PR helps address:
typingTtlSecondsto extend the indicator duration for long-running inference.typingTtlSecondskeeps the indicator active through longer dispatch phases.Closes #7192
Helps mitigate #5637
Changes
zod-schema.agent-defaults.tszod-schema.session.tstypes.agent-defaults.tstypes.base.tsget-reply.tstyping.test.tsdocs/concepts/typing-indicators.mdUsage
Greptile Overview
Greptile Summary
Adds a new
typingTtlSecondsconfiguration option alongsidetypingIntervalSeconds, wiring it intogetReplyFromConfigto passtypingTtlMsinto the typing controller. Updates agent/session config types and Zod schemas to accept the new field, expands typing controller tests to cover TTL expiration, and documents the option in the typing-indicators concept doc.This fits the existing typing-indicator architecture by keeping TTL enforcement inside
createTypingController(ms-based), while allowing the higher-level reply pipeline to source configuration from agent defaults and session overrides (seconds-based) and convert once at the boundary.Confidence Score: 4/5
(2/5) Greptile learns from your feedback when you react with thumbs up/down!