Skip to content

fix: assistant for project does not work#7509

Merged
louis-jan merged 3 commits into
release/v0.7.7from
fix/assistant-for-project
Feb 11, 2026
Merged

fix: assistant for project does not work#7509
louis-jan merged 3 commits into
release/v0.7.7from
fix/assistant-for-project

Conversation

@louis-jan
Copy link
Copy Markdown
Contributor

Describe Your Changes

  • Fix assistant does not work in Project

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Copilot AI review requested due to automatic review settings February 11, 2026 09:32
Vanalite
Vanalite previously approved these changes Feb 11, 2026
Minh141120
Minh141120 previously approved these changes Feb 11, 2026
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

Fixes project-created threads not applying their assistant instructions by ensuring the thread’s assigned assistant is always used to generate the systemMessage passed into the chat transport.

Changes:

  • Remove the projectId-based guard that prevented using thread.assistants[0] when the thread belongs to a project.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web-app/src/routes/threads/$threadId.tsx
@louis-jan louis-jan dismissed stale reviews from Minh141120 and Vanalite via 3668088 February 11, 2026 09:38
Minh141120
Minh141120 previously approved these changes Feb 11, 2026
urmauur
urmauur previously approved these changes Feb 11, 2026
Copilot AI review requested due to automatic review settings February 11, 2026 09:43
@louis-jan louis-jan dismissed stale reviews from urmauur and Minh141120 via 79d7e5f February 11, 2026 09:43
@louis-jan louis-jan merged commit f892648 into release/v0.7.7 Feb 11, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this to QA in Jan Feb 11, 2026
@louis-jan louis-jan deleted the fix/assistant-for-project branch February 11, 2026 09:43
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

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

Comments suppressed due to low confidence (4)

web-app/src/services/tests/threads.test.ts:4

  • Unused imports ConversationalExtension, ExtensionTypeEnum.
import { ConversationalExtension, ExtensionTypeEnum } from '@janhq/core'

web-app/src/services/tests/threads.test.ts:206

  • Unused variable result.
      const result = threadsService.updateThread(thread as Thread)

web-app/src/services/tests/threads.test.ts:363

  • Unused variable result.
      const result = await threadsService.createThread(inputThread as Thread)

web-app/src/services/tests/threads.test.ts:397

  • Unused variable result.
      const result = await threadsService.createThread(inputThread as Thread)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -29,8 +31,7 @@ export class DefaultThreadsService implements ThreadsService {
: undefined

// Check if this is a "real" assistant (has instructions) or just model storage
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The comment says we only keep a "real" assistant when it has instructions, but the code now always forwards e.assistants unchanged. Please update/remove the comment to reflect the new behavior (or reintroduce the instructions-based filtering if that's still required).

Suggested change
// Check if this is a "real" assistant (has instructions) or just model storage
// Forward assistants array as-is (no filtering by instructions)

Copilot uses AI. Check for mistakes.
Comment on lines 68 to 72
// Build assistants payload - always include model info
// If there's a real assistant (with instructions), include full assistant data
// Otherwise, just include minimal model-only entry for storage
const hasRealAssistant = thread.assistants && thread.assistants.length > 0 && thread.assistants[0]?.instructions
const hasRealAssistant = thread.assistants && thread.assistants.length > 0
const assistantsPayload = hasRealAssistant
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

hasRealAssistant is now based only on thread.assistants.length > 0, but the nearby comments still describe "real assistant (with instructions)" behavior. Consider renaming the flag (or updating the comments) so the naming/docs match the actual condition being checked.

Copilot uses AI. Check for mistakes.
louis-jan pushed a commit that referenced this pull request Feb 12, 2026
* fix: temporary disable prompt cache

* fix: broken assistant selection

* fix: default asistant

* Merge pull request #7509 from janhq/fix/assistant-for-project

fix: assistant for project does not work

---------

Co-authored-by: Faisal Amir <urmauur@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

5 participants