Skip to content

feat: allow assistant to work on unsaved jobs#4416

Merged
doc-han merged 8 commits intomainfrom
allow-unsaved-jobs-in-ai-assistant
Feb 19, 2026
Merged

feat: allow assistant to work on unsaved jobs#4416
doc-han merged 8 commits intomainfrom
allow-unsaved-jobs-in-ai-assistant

Conversation

@doc-han
Copy link
Contributor

@doc-han doc-han commented Feb 11, 2026

Description

This PR allows the AI assistant to work on unsaved jobs.

Closes #4417 #4412

Validation steps

New unsaved workflow

  1. Generate a new workflow using AI, don't click "create" yet
  2. enter one of the nodes and use the AI chat to write some job code even tho it's not save.
  3. we expect it to work

Already saved workflow with new nodes

  1. You have an already saved workflow but then you add a new node manually or via AI chat.
  2. enter that unsaved node and then write some job code
  3. we expect it to work

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 11, 2026
@doc-han doc-han marked this pull request as ready for review February 11, 2026 10:51
… job_chat?

@doc false is unnecessary on private functions. Renamed predicate to
follow Elixir convention and fix Credo lint failure.
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.34%. Comparing base (c7e5016) to head (58e9749).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lib/lightning_web/channels/ai_assistant_channel.ex 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4416      +/-   ##
==========================================
+ Coverage   89.26%   89.34%   +0.07%     
==========================================
  Files         425      425              
  Lines       20090    20128      +38     
==========================================
+ Hits        17933    17983      +50     
+ Misses       2157     2145      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

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

Hey @doc-han this is a really nice little feature that will have a huge impact on the AI Assistant's UX. Thanks a lot dude. I have left a few questions (mainly for my own curiosity and learning). I could approve this as is, but I think you'll need to add a few tests to cover at least the new handle_unsaved_job_message path in the channel and the job_chat? / update_session_with_job_context logic in the message processor.

@github-project-automation github-project-automation bot moved this from New Issues to In review in v2 Feb 12, 2026
@josephjclark
Copy link
Collaborator

This is probably unrelated @doc-han but here's another issue in the same area:

  • Edit an unsaved job
  • Generate code with AI
  • Close the AI Assistant
  • The inspector freaks out and leaves you with this
image

@doc-han
Copy link
Contributor Author

doc-han commented Feb 16, 2026

This is probably unrelated @doc-han but here's another issue in the same area:

  • Edit an unsaved job
  • Generate code with AI
  • Close the AI Assistant
  • The inspector freaks out and leaves you with this
image

noted and resolved.

@doc-han doc-han requested a review from elias-ba February 16, 2026 14:38
Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

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

Nicely done Commander Han ! ⚔️

@josephjclark
Copy link
Collaborator

What about those failing tests? Do they need fixing or can we merge?

@elias-ba
Copy link
Contributor

Hey @josephjclark no failing tests but we could improve the coverage of the ai_assistant_channel.ex. Let me push a commit with one test that could do us good here.

@doc-han
Copy link
Contributor Author

doc-han commented Feb 18, 2026

@elias-ba dealing with that

@doc-han
Copy link
Contributor Author

doc-han commented Feb 19, 2026

@elias-ba codecov looking good now. thanks

@doc-han doc-han merged commit a3126d7 into main Feb 19, 2026
7 checks passed
@doc-han doc-han deleted the allow-unsaved-jobs-in-ai-assistant branch February 19, 2026 06:25
@github-project-automation github-project-automation bot moved this from In review to Done in v2 Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow single-chat AI assistant for unsaved jobs.

3 participants

Comments