Skip to content

add: document call.timeElapsed hook for assistant hooks#1017

Merged
dhruva-reddy merged 1 commit intomainfrom
dr/add-time-elapsed-hook-docs
Apr 9, 2026
Merged

add: document call.timeElapsed hook for assistant hooks#1017
dhruva-reddy merged 1 commit intomainfrom
dr/add-time-elapsed-hook-docs

Conversation

@dhruva-reddy
Copy link
Copy Markdown
Contributor

Description

  • Added documentation for the call.timeElapsed assistant hook event, which was implemented in the codebase but missing from docs
  • Updated the supported events list to include call.timeElapsed
  • Updated the "How hooks work" section to mention call.timeElapsed in the options description
  • Added three example subsections:
    • Basic usage: simple time-based notification
    • Call discipline (wrap-up and graceful close): multi-stage pattern combining call.timeElapsed hooks with maxDurationSeconds for structured call ending
    • Inject a system message to guide the LLM: using message.add action to change LLM behavior at a time threshold
  • Added "Enforce call duration limits with graceful wrap-up behavior" to the common use cases list
  • File modified: fern/assistants/assistant-hooks.mdx

The call.timeElapsed hook is fully implemented in libs/core/src/types/call.types/call.hooks.types.ts and scheduled at runtime via hookStream.ts. It fires once at a specified number of seconds (1-3600) from call start. This documentation fills the gap so customers can discover and use this feature.

Testing Steps

  • Run fern check -- passes with 0 errors (4 pre-existing warnings)
  • Verify JSON examples are valid -- all new JSON blocks parse correctly (1 pre-existing invalid block in existing content, not introduced by this PR)
  • Verify internal links resolve -- no new internal links added (2 pre-existing broken API reference hash links, not introduced by this PR)
  • Confirm new content appears in the correct position (after "Handle customer speech timeout", before "Handle low confidence transcripts")
  • Review page content for style guide compliance (active voice, present tense, no marketing language)
  • Cross-checked options.seconds field name, min/max values (1-3600), and one-shot behavior against source types in call.hooks.types.ts

The call.timeElapsed hook exists in the codebase but was missing from
documentation. This adds full documentation including basic usage,
call discipline patterns with graceful wrap-up, and system message
injection for guiding LLM behavior at specific time points.
@dhruva-reddy dhruva-reddy changed the title feat: document call.timeElapsed hook for assistant hooks add: document call.timeElapsed hook for assistant hooks Apr 9, 2026
@dhruva-reddy dhruva-reddy requested a review from Shanay123 April 9, 2026 20:31
@dhruva-reddy dhruva-reddy self-assigned this Apr 9, 2026
@dhruva-reddy dhruva-reddy requested a review from roshan-vapi April 9, 2026 20:34
@dhruva-reddy dhruva-reddy merged commit 4bf6663 into main Apr 9, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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