Skip to content

Verify and document dynamic question choices with runtime code execution - #2

Draft
jamesbeedy with Copilot wants to merge 10 commits into
mainfrom
copilot/implement-jobbergate-agent-fastapi
Draft

jamesbeedy with Copilot wants to merge 10 commits into
mainfrom
copilot/implement-jobbergate-agent-fastapi

Conversation

Copilot AI commented Feb 12, 2026

Copy link
Copy Markdown

Question choices can be derived from filesystem state or runtime code execution. Investigation confirms this already works - inquirer executes callable choices parameters, and questions reload after each answer via _load_workflow().

Changes

Tests (tests/test_dynamic_choices.py)

  • Filesystem-based choices: verify choices evaluated from os.listdir()
  • Conditional choices: verify choices change based on previous answers

Example application (examples/dynamic-choices-application/)

  • Demonstrates 5 patterns: filesystem listing, conditionals, nested conditionals, environment-aware, answer-dependent
  • Ready-to-use reference for application developers

Documentation

  • Explains callable choices mechanism
  • Shows question reload behavior on answer submission

Mechanism

def mainflow(self, data=None):
    def get_files(answers):
        """Executed when question created/reloaded"""
        return os.listdir('/path')
    
    return [List('file', message='Choose:', choices=get_files)]

Inquirer calls the function immediately, storing the result. Since _load_workflow() runs after each answer (session_manager.py:78), choices stay current with filesystem/answer state.

No implementation changes required - feature already functional.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 12, 2026 20:31
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add jobbergate agent fastapi application for question answering Add jobbergate-agent-fastapi: REST API for remote application question/answer workflows Feb 12, 2026
Copilot AI requested a review from jamesbeedy February 12, 2026 20:45
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Copilot AI changed the title Add jobbergate-agent-fastapi: REST API for remote application question/answer workflows Integrate jobbergate-agent-fastapi with API via jobbergate_core SDK Feb 12, 2026
Copilot AI and others added 2 commits February 12, 2026 22:00
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Copilot AI changed the title Integrate jobbergate-agent-fastapi with API via jobbergate_core SDK Add JWT authentication to jobbergate-agent-fastapi with permission-based access control Feb 12, 2026
Copilot AI and others added 2 commits February 12, 2026 23:21
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Co-authored-by: jamesbeedy <5590546+jamesbeedy@users.noreply.github.com>
Copilot AI changed the title Add JWT authentication to jobbergate-agent-fastapi with permission-based access control Verify and document dynamic question choices with runtime code execution Feb 12, 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