Skip to content

- observation memory update#140

Merged
ssdeanx merged 2 commits intomainfrom
develop
Apr 16, 2026
Merged

- observation memory update#140
ssdeanx merged 2 commits intomainfrom
develop

Conversation

@ssdeanx
Copy link
Copy Markdown
Owner

@ssdeanx ssdeanx commented Apr 16, 2026

Summary by Sourcery

Tune libsql-backed conversational memory behavior and upgrade AI SDK dependencies.

New Features:

  • Capture additional user profile information via an other field in the memory prompt template.
  • Highlight important information in the memory prompt via a dedicated Important Information section.

Enhancements:

  • Adjust libsql memory concurrency and token budgets for observation and reflection to better manage resource usage and latency.
  • Enable resource-scoped observational memory with vector-based retrieval and shared token budgeting between observation and reflection.
  • Introduce buffer activation and blocking thresholds for observation and reflection to control synchronous processing behavior.
  • Bump @ai-sdk/react and ai packages (and override) to the latest patch versions.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 16, 2026 07:52
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-stack Error Error Apr 16, 2026 10:29am

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 21c43eeb-6792-4b91-bb17-e80adc2ce557

📥 Commits

Reviewing files that changed from the base of the PR and between b29edbb and 3fa08c5.

⛔ Files ignored due to path filters (4)
  • package-lock.json is excluded by !**/package-lock.json
  • src/mastra/workflows/gen/gen-identifier-pack.workflow.ts is excluded by !**/gen/**
  • src/mastra/workflows/gen/gen-outline.workflow.ts is excluded by !**/gen/**
  • src/mastra/workflows/gen/gen-variant.workflow.ts is excluded by !**/gen/**
📒 Files selected for processing (45)
  • .gitignore
  • .storybook/main.ts
  • .storybook/preview.ts
  • app/.well-known/agent-configuration/route.ts
  • app/.well-known/oauth-authorization-server/route.ts
  • app/.well-known/oauth-protected-resource/route.ts
  • app/api/auth/[...all]/route.ts
  • app/chat/layout.tsx
  • app/device/_components/device-approval-form.tsx
  • app/device/_components/device-authorization-form.tsx
  • app/device/approve/page.tsx
  • app/device/page.tsx
  • eslint.config.js
  • lib/auth-client.ts
  • package.json
  • src/components/ai-elements/code-block.tsx
  • src/components/ai-elements/commit.tsx
  • src/components/ai-elements/conversation.tsx
  • src/components/ai-elements/edge.tsx
  • src/components/ai-elements/file-tree.tsx
  • src/mastra/agents/image.ts
  • src/mastra/auth.test.ts
  • src/mastra/auth.ts
  • src/mastra/config/anthropic.ts
  • src/mastra/config/convex.ts
  • src/mastra/config/github-copilot.ts
  • src/mastra/config/libsql.ts
  • src/mastra/config/mongodb.ts
  • src/mastra/config/openrouter.ts
  • src/mastra/config/upstash.ts
  • src/mastra/config/vertex.ts
  • src/mastra/mcp/index.ts
  • src/mastra/mcp/mcp-client.ts
  • src/mastra/mcp/resources.ts
  • src/mastra/test-setup.ts
  • src/stories/Button.stories.ts
  • src/stories/Button.tsx
  • src/stories/Configure.mdx
  • src/stories/Header.stories.ts
  • src/stories/Header.tsx
  • src/stories/Page.stories.ts
  • src/stories/Page.tsx
  • src/stories/button.css
  • src/stories/header.css
  • src/stories/page.css

Summary by CodeRabbit

Release Notes

  • New Features

    • Added device authorization flow for approving and managing device access.
    • Integrated Storybook for interactive component documentation and testing.
  • Improvements

    • Enhanced accessibility for file tree navigation with ARIA attributes.
    • Improved authentication configuration for agent and device authorization scenarios.
  • Chores

    • Updated dependencies including Storybook tooling packages.
    • Added ESLint rules for code quality improvements.
    • Cleaned up unused imports and configuration settings.

Walkthrough

This PR introduces comprehensive Storybook integration with configuration and example components, adds a complete device authorization workflow with new pages and components, establishes OAuth discovery metadata endpoints, refactors authentication to export authOptions and device client utilities, and performs import cleanup across configuration files.

Changes

Cohort / File(s) Summary
Storybook Setup
.gitignore, .storybook/main.ts, .storybook/preview.ts, eslint.config.js, package.json
Storybook initialization with Next.js framework configuration, addon registration (addon-a11y, addon-docs, addon-onboarding), control matchers for color/date fields, ESLint plugin integration, and npm scripts for dev/build.
Storybook Components & Stories
src/stories/Button.tsx, src/stories/Button.stories.ts, src/stories/Header.tsx, src/stories/Header.stories.ts, src/stories/Page.tsx, src/stories/Page.stories.ts, src/stories/Configure.mdx, src/stories/*.css
Complete Storybook component library including reusable Button, Header, and Page components with stories demonstrating various prop combinations and interaction tests; supporting stylesheets and configuration documentation page.
Device Authorization Flow
app/device/page.tsx, app/device/approve/page.tsx, app/device/_components/device-authorization-form.tsx, app/device/_components/device-approval-form.tsx, lib/auth-client.ts
New device authorization/approval workflow with entry page for code submission, approval page, client-side forms handling code validation/normalization, and exported auth client utilities (normalizeDeviceUserCode, checkDeviceAuthorizationCode, approveDeviceAuthorization, denyDeviceAuthorization).
OAuth Discovery Endpoints
app/.well-known/agent-configuration/route.ts, app/.well-known/oauth-authorization-server/route.ts, app/.well-known/oauth-protected-resource/route.ts
New Well-Known routes serving OAuth/agent metadata via force-dynamic rendering, using oAuthDiscoveryMetadata and oAuthProtectedResourceMetadata plugins from better-auth.
Authentication Refactoring
src/mastra/auth.ts, src/mastra/auth.test.ts, src/mastra/test-setup.ts, app/api/auth/[...all]/route.ts, app/chat/layout.tsx
Exported authOptions constant, added MCP and agent auth plugins with capability handlers, introduced test auth setup module, updated import paths to use new alias (@/src/mastra/auth), switched chat layout session retrieval to use authClient.getSession().
MCP & Config Cleanup
src/mastra/mcp/index.ts, src/mastra/mcp/mcp-client.ts, src/mastra/mcp/resources.ts, src/mastra/agents/image.ts, src/mastra/config/anthropic.ts, src/mastra/config/convex.ts, src/mastra/config/github-copilot.ts, src/mastra/config/libsql.ts, src/mastra/config/mongodb.ts, src/mastra/config/openrouter.ts, src/mastra/config/upstash.ts, src/mastra/config/vertex.ts
Removed/commented unused imports and environment constants; refactored observation/semantic recall/working memory configuration in libsql with scope changes, vector retrieval, and template fixes; added TypeScript type augmentation for NodeJS.ErrnoException.
Accessibility & Linting
src/components/ai-elements/code-block.tsx, src/components/ai-elements/commit.tsx, src/components/ai-elements/conversation.tsx, src/components/ai-elements/edge.tsx, src/components/ai-elements/file-tree.tsx
Added ESLint suppression directives for react-refresh/only-export-components; enhanced file-tree accessibility with role="group" on container and aria-selected attribute on treeitem elements.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Browser as Browser
    participant DeviceAuth as Device Auth<br/>Pages
    participant AuthClient as Auth Client<br/>(Client-Side)
    participant AuthAPI as Auth API<br/>(Server)

    User->>Browser: Visit /device
    Browser->>DeviceAuth: Load DeviceAuthorizationForm
    DeviceAuth->>AuthClient: useAuthQuery() - check session
    AuthClient->>AuthAPI: Get session
    AuthAPI-->>AuthClient: Session status
    AuthClient-->>DeviceAuth: Session data
    
    alt User authenticated
        DeviceAuth-->>User: Show code entry form
        User->>DeviceAuth: Enter device code
        DeviceAuth->>AuthClient: checkDeviceAuthorizationCode(code)
        AuthClient->>AuthAPI: Lookup device code
        AuthAPI-->>AuthClient: Device found
        AuthClient-->>DeviceAuth: Success response
        DeviceAuth-->>Browser: Redirect to /device/approve?user_code=...
    else User not authenticated
        DeviceAuth-->>Browser: Redirect to /login
    end

    Browser->>DeviceAuth: Load DeviceApprovalForm
    DeviceAuth->>AuthClient: useAuthQuery() - check session
    AuthClient->>AuthAPI: Get session
    AuthAPI-->>AuthClient: Session + user info
    AuthClient-->>DeviceAuth: Session data
    
    DeviceAuth-->>User: Show approval dialog
    User->>DeviceAuth: Click approve/deny button
    
    alt User approves
        DeviceAuth->>AuthClient: approveDeviceAuthorization(userCode)
        AuthClient->>AuthAPI: Approve device
        AuthAPI-->>AuthClient: Success
        AuthClient-->>DeviceAuth: Approval confirmed
        DeviceAuth-->>Browser: Redirect to /chat
    else User denies
        DeviceAuth->>AuthClient: denyDeviceAuthorization(userCode)
        AuthClient->>AuthAPI: Deny device
        AuthAPI-->>AuthClient: Denial confirmed
        AuthClient-->>DeviceAuth: Show denial message
    end
Loading
sequenceDiagram
    participant Client as OAuth Client
    participant Well-Known as Well-Known<br/>Endpoints
    participant AuthServer as Auth Server
    participant BetterAuth as Better Auth<br/>(Plugin)

    Client->>Well-Known: GET /.well-known/oauth-authorization-server
    Well-Known->>Well-Known: force-dynamic routing
    Well-Known->>BetterAuth: oAuthDiscoveryMetadata(auth)
    BetterAuth->>AuthServer: Generate OAuth metadata
    AuthServer-->>BetterAuth: Metadata object
    BetterAuth-->>Well-Known: Formatted response
    Well-Known-->>Client: JSON response

    Client->>Well-Known: GET /.well-known/oauth-protected-resource
    Well-Known->>BetterAuth: oAuthProtectedResourceMetadata(auth)
    BetterAuth->>AuthServer: Generate resource metadata
    AuthServer-->>BetterAuth: Resource metadata
    BetterAuth-->>Well-Known: Formatted response
    Well-Known-->>Client: JSON response

    Client->>Well-Known: GET /.well-known/agent-configuration
    Well-Known->>AuthServer: auth.api.getAgentConfiguration()
    AuthServer-->>Well-Known: Agent config
    Well-Known-->>Client: JSON response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • sourcery-ai

🐰 Hops with glee,
Storybooks bloom with colors bright,
Auth flows dance in flight—
Device dance, OAuth light,
Tales of config, ESLint's might! 🎪

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🤖 Hi @ssdeanx, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 16, 2026

Reviewer's Guide

Adjusts libsql observation memory configuration to use resource-scoped vector retrieval with tuned token thresholds and buffering behavior, and bumps ai-related dependencies to the latest patch versions.

Class diagram for updated LibsqlMemory observational configuration

classDiagram
    class Memory {
        +options MemoryOptions
        +config MemoryConfig
    }

    class MemoryConfig {
        +maxParallelCalls number
    }

    class MemoryOptions {
        +readOnly boolean
        +observationalMemory ObservationalMemoryOptions
        +lastMessages number
        +template string
    }

    class ObservationalMemoryOptions {
        +enabled boolean
        +scope string
        +model string
        +retrieval RetrievalConfig
        +shareTokenBudget boolean
        +observation ObservationConfig
        +reflection ReflectionConfig
    }

    class RetrievalConfig {
        +vector boolean
        +scope string
    }

    class ObservationConfig {
        +instruction string
        +messageTokens number
        +bufferTokens number
        +bufferActivation number
        +blockAfter number
        +modelSettings ObservationModelSettings
    }

    class ReflectionConfig {
        +instruction string
        +observationTokens number
        +bufferActivation number
        +blockAfter number
        +modelSettings ReflectionModelSettings
    }

    class ObservationModelSettings {
        +temperature number
        +maxOutputTokens number
        +topK number
        +topP number
    }

    class ReflectionModelSettings {
        +temperature number
        +maxOutputTokens number
        +topK number
        +topP number
    }

    Memory --> MemoryConfig
    Memory --> MemoryOptions
    MemoryOptions --> ObservationalMemoryOptions
    MemoryOptions --> RetrievalConfig : uses
    ObservationalMemoryOptions --> RetrievalConfig
    ObservationalMemoryOptions --> ObservationConfig
    ObservationalMemoryOptions --> ReflectionConfig
    ObservationConfig --> ObservationModelSettings
    ReflectionConfig --> ReflectionModelSettings
Loading

Flow diagram for observation and reflection buffering behavior

flowchart TD
    A[Start token update] --> B{Mode}

    B -->|Observation| C[Current message tokens]
    C --> D{Tokens >= messageTokens * bufferActivation}
    D -->|No| E[Continue async observation]
    D -->|Yes| F{Tokens >= messageTokens * blockAfter}
    F -->|No| G[Activate observation buffer]
    G --> H[Prefer flushing buffer soon]
    F -->|Yes| I[Force synchronous observation]

    B -->|Reflection| J[Current observation tokens]
    J --> K{Tokens >= observationTokens * bufferActivation}
    K -->|No| L[Continue async reflection]
    K -->|Yes| M{Tokens >= observationTokens * blockAfter}
    M -->|No| N[Activate reflection buffer]
    N --> O[Prefer flushing buffer soon]
    M -->|Yes| P[Force synchronous reflection]

    E --> Q[End]
    H --> Q
    I --> Q
    L --> Q
    O --> Q
    P --> Q
Loading

File-Level Changes

Change Details Files
Retune observation and reflection memory configuration for libsql-backed Memory instance.
  • Reduce maxParallelCalls for embedding calls to lower load and rate-limit risk.
  • Switch observationalMemory scope from thread-level to resource-level and enable vector retrieval scoped to resource.
  • Enable token budget sharing between observation and reflection.
  • Adjust observation token thresholds, adding bufferTokens, bufferActivation, and blockAfter for more controlled flushing and synchronous behavior.
  • Add bufferActivation and blockAfter parameters to reflection and lower reflection observationTokens to 40,000.
src/mastra/config/libsql.ts
Enhance memory reflection template with additional user and conversation context fields.
  • Include optional user.other field in the context section.
  • Fix Handlebars loop closing for additionalContext and add a separate Important Information section iterating over importantInfo entries.
src/mastra/config/libsql.ts
Bump ai-related dependencies to newer patch versions.
  • Update @ai-sdk/react from 3.0.164 to 3.0.165 in dependencies.
  • Update ai from 6.0.162 to 6.0.163 in dependencies and overrides.
  • Regenerate package-lock.json to reflect the dependency bumps.
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 16, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
lib/auth-client.ts 117 Incorrect signup method - uses email but function is for username signup
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
lib/auth-client.ts 117 Incorrect signup method - uses email but function is for username signup. Should be authClient.signUp.username(input) to match the usernameClient() plugin.
Files Reviewed (19 files)
  • .gitignore - Added Storybook ignores
  • .storybook/main.ts - Storybook configuration
  • .storybook/preview.ts - Storybook preview settings
  • app/.well-known/agent-configuration/route.ts - OAuth agent config route
  • app/.well-known/oauth-authorization-server/route.ts - OAuth discovery metadata
  • app/.well-known/oauth-protected-resource/route.ts - OAuth protected resource metadata
  • app/api/auth/[...all]/route.ts - Auth route import fix
  • app/chat/layout.tsx - Auth client usage update
  • app/device/_components/device-approval-form.tsx - Device approval UI
  • app/device/_components/device-authorization-form.tsx - Device verification UI
  • app/device/approve/page.tsx - Device approval page
  • app/device/page.tsx - Device authorization page
  • eslint.config.js - Storybook ESLint config
  • lib/auth-client.ts - Auth client with device auth
  • package-lock.json - Dependency updates

Reviewed by grok-code-fast-1:optimized:free · 275,586 tokens

@github-actions
Copy link
Copy Markdown

🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The shareTokenBudget option is now set to true but the inline comment still says "Don't share token budget..."—update the comment to accurately describe the new behavior to avoid confusion.
  • The indentation of maxParallelCalls: 20 no longer matches the surrounding configuration object; consider realigning it for consistency with the existing formatting style.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `shareTokenBudget` option is now set to `true` but the inline comment still says "Don't share token budget..."—update the comment to accurately describe the new behavior to avoid confusion.
- The indentation of `maxParallelCalls: 20` no longer matches the surrounding configuration object; consider realigning it for consistency with the existing formatting style.

## Individual Comments

### Comment 1
<location path="src/mastra/config/libsql.ts" line_range="69" />
<code_context>
             model: 'google/gemini-2.5-flash',
-            shareTokenBudget: false, // Don't share token budget between observation and reflection to preserve context
+            retrieval: { vector: true, scope: 'resource' },
+            shareTokenBudget: true, // Don't share token budget between observation and reflection to preserve context
             observation: {
                 instruction: 'You are an assistant that observes and remembers important information from the conversation. Pay attention to details, context, and any information that might be useful for future reference.',
</code_context>
<issue_to_address>
**issue:** The `shareTokenBudget` comment contradicts the new boolean value.

The flag and its comment now disagree: `true` implies the budget is shared, while the comment says it isn’t. Please either revert to `false` if that behavior is still desired, or update the comment to accurately describe the new behavior to avoid confusion for future readers.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

model: 'google/gemini-2.5-flash',
shareTokenBudget: false, // Don't share token budget between observation and reflection to preserve context
retrieval: { vector: true, scope: 'resource' },
shareTokenBudget: true, // Don't share token budget between observation and reflection to preserve context
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The shareTokenBudget comment contradicts the new boolean value.

The flag and its comment now disagree: true implies the budget is shared, while the comment says it isn’t. Please either revert to false if that behavior is still desired, or update the comment to accurately describe the new behavior to avoid confusion for future readers.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates AI-related dependencies and reconfigures the LibsqlMemory settings, including reducing parallel calls, changing the memory scope to 'resource', and adjusting token thresholds for observation and reflection. Prompt templates were also expanded to include more context. Feedback was provided regarding a contradictory comment in the configuration file where the code change was not reflected in the documentation.

model: 'google/gemini-2.5-flash',
shareTokenBudget: false, // Don't share token budget between observation and reflection to preserve context
retrieval: { vector: true, scope: 'resource' },
shareTokenBudget: true, // Don't share token budget between observation and reflection to preserve context
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment contradicts the code change. The value was changed to true, but the comment still says "Don't share token budget". Please update the comment to reflect the actual behavior.

            shareTokenBudget: true, // Share token budget between observation and reflection

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Mastra LibSQL-backed memory configuration (observational memory behavior + working memory template) and bumps AI SDK dependencies to the latest patch versions.

Changes:

  • Tuned LibSQL Memory observational-memory settings (scope, retrieval, token/buffering thresholds, parallel embed calls).
  • Extended working-memory template to include additional user/context sections.
  • Bumped @ai-sdk/react and ai patch versions (and lockfile accordingly).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/mastra/config/libsql.ts Adjusts observational-memory configuration and working-memory template fields/sections.
package.json Patch bumps for @ai-sdk/react and ai (plus override).
package-lock.json Lockfile updates matching the dependency bumps.

model: 'google/gemini-2.5-flash',
shareTokenBudget: false, // Don't share token budget between observation and reflection to preserve context
retrieval: { vector: true, scope: 'resource' },
shareTokenBudget: true, // Don't share token budget between observation and reflection to preserve context
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shareTokenBudget is set to true, but the inline comment says "Don't share token budget between observation and reflection". Either flip the value to false or update the comment to match the behavior, otherwise future readers will misconfigure this option.

Suggested change
shareTokenBudget: true, // Don't share token budget between observation and reflection to preserve context
shareTokenBudget: true, // Share token budget between observation and reflection to balance context usage

Copilot uses AI. Check for mistakes.
messageTokens: 60_000,
messageTokens: 50_000,
bufferTokens: 5_000,
// Activate to retain 30% of threshold
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about bufferActivation doesn't match the configured value. bufferActivation: 0.85 means the buffer activates at 85% of the threshold, but the comment says "retain 30% of threshold". Please update the comment (or the value) so they stay consistent.

Suggested change
// Activate to retain 30% of threshold
// Activate at 85% of the threshold

Copilot uses AI. Check for mistakes.
- Implemented `DeviceAuthorizationForm` component for user code input and verification.
- Created `DeviceApprovalPage` to handle device approval requests.
- Added `DeviceAuthorizationPage` for device verification process.
- Integrated `checkDeviceAuthorizationCode` and `normalizeDeviceUserCode` for handling user codes.

test: set up testing utilities for authentication
- Added `auth.test.ts` to configure Better Auth with test utilities.
- Created `test-setup.ts` to export authentication context for testing.

feat: add Storybook stories and components
- Developed `Button` component with various sizes and styles.
- Created `Header` component with login/logout functionality.
- Implemented `Page` component to demonstrate usage of `Header` and `Button`.
- Added Storybook stories for `Button`, `Header`, and `Page` components.
- Included styles for `Button`, `Header`, and `Page` components in respective CSS files.

docs: create configuration documentation for Storybook
- Added `Configure.mdx` to provide guidance on configuring Storybook for projects.
@ssdeanx ssdeanx merged commit da86f21 into main Apr 16, 2026
6 of 10 checks passed
Comment thread src/stories/button.css
line-height: 1;
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.storybook-button--primary {
Comment thread src/stories/button.css
background-color: #555ab9;
color: white;
}
.storybook-button--secondary {
Comment thread src/stories/button.css
color: white;
}
.storybook-button--secondary {
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
Comment thread src/stories/button.css
background-color: transparent;
color: #333;
}
.storybook-button--small {
Comment thread src/stories/button.css
padding: 10px 16px;
font-size: 12px;
}
.storybook-button--medium {
Comment thread src/stories/button.css
padding: 11px 20px;
font-size: 14px;
}
.storybook-button--large {
Comment thread src/stories/page.css
line-height: 20px;
}

.storybook-page .tip-wrapper svg {
Comment thread src/stories/page.css
line-height: 12px;
}

.storybook-page .tip-wrapper {
Comment thread src/stories/page.css
margin-bottom: 8px;
}

.storybook-page .tip {
Comment thread src/stories/page.css
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.storybook-page h2 {
Comment thread src/stories/page.css
@@ -0,0 +1,68 @@
.storybook-page {
Comment thread src/stories/button.css
@@ -0,0 +1,30 @@
.storybook-button {
Comment thread src/stories/header.css
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
Comment thread src/stories/header.css
vertical-align: top;
}

.storybook-header h1 {
Comment thread src/stories/page.css
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.storybook-page h2 {
Comment thread src/stories/button.css
color: white;
}
.storybook-button--secondary {
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
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.

3 participants