Open
Conversation
Comment on lines
+930
to
+937
|
|
||
| reader.releaseLock(); | ||
|
|
||
| // Finalize usage using internal Raycast-specific action (no JWT auth) | ||
| await ctx.runAction(internal.raycastUsage.finalizeUsageForRaycast, { | ||
| instanceId: instance._id, | ||
| questionTokens: 0, // Simplified for RayCast | ||
| outputChars: 0, |
Contributor
There was a problem hiding this comment.
usage finalization called with hardcoded 0 values - actual token counts and usage metrics not being tracked
Suggested change
| reader.releaseLock(); | |
| // Finalize usage using internal Raycast-specific action (no JWT auth) | |
| await ctx.runAction(internal.raycastUsage.finalizeUsageForRaycast, { | |
| instanceId: instance._id, | |
| questionTokens: 0, // Simplified for RayCast | |
| outputChars: 0, | |
| // Finalize usage using internal Raycast-specific action (no JWT auth) | |
| // TODO: Track actual token counts and output metrics | |
| await ctx.runAction(internal.raycastUsage.finalizeUsageForRaycast, { | |
| instanceId: instance._id, | |
| questionTokens: inputTokens, // Use actual calculated tokens | |
| outputChars: accumulatedChars, // Track accumulated output | |
| reasoningChars: 0, | |
| resources, | |
| sandboxUsageHours: sandboxUsageHours | |
| }); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/src/convex/http.ts
Line: 930:937
Comment:
usage finalization called with hardcoded 0 values - actual token counts and usage metrics not being tracked
```suggestion
// Finalize usage using internal Raycast-specific action (no JWT auth)
// TODO: Track actual token counts and output metrics
await ctx.runAction(internal.raycastUsage.finalizeUsageForRaycast, {
instanceId: instance._id,
questionTokens: inputTokens, // Use actual calculated tokens
outputChars: accumulatedChars, // Track accumulated output
reasoningChars: 0,
resources,
sandboxUsageHours: sandboxUsageHours
});
```
How can I resolve this? If you propose a fix, please make it concise.
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.

plan put together
plan put together
raycast first exploration done, needs ui pass
Greptile Overview
Greptile Summary
This PR implements a Raycast extension for Better Context, allowing users to ask questions with
@resourcetagging directly from Raycast. The implementation includes new backend HTTP endpoints for authentication and streaming responses, along with a complete Raycast extension UI.Key changes:
/raycast/resourcesand/raycast/askHTTP endpoints with API key authenticationraycastAuth.tsfor API key validation andraycastUsage.tsfor billing integrationbtca.config.jsoncIssues found:
RAYCAST-EXTENSION.mdplan file should be removed before merging (per repository instructions to check for plan files)/raycast/askendpoint uses hardcoded 0 values instead of actual token counts and metrics, which could cause billing inaccuraciesNotes:
https://greedy-partridge-784.convex.site) is correct for productionapiKeys.tsmeets security requirementsConfidence Score: 4/5
apps/web/src/convex/http.ts(usage tracking) and removeRAYCAST-EXTENSION.mdImportant Files Changed
/raycast/resourcesand/raycast/askwith SSE streaming; usage tracking has hardcoded 0 values