Repository: ErikBjare/gptme
File: gptme/prompts.py (Python)

Code before:
    )
    include_agent = effective_mode == "full" or (
        effective_mode == "selective" and "agent" in include_set
    )

    # Generate core system messages (without workspace context)
    core_msgs: list[Message]
    if effective_mode == "instructions-only":
        # Minimal mode: only basic gptme prompt
        core_msgs = list(prompt_gptme(interactive, model, agent_name))
    elif prompt == "full":
        if include_tools:
            core_msgs = list(
                prompt_full(
                    interactive, tools, tool_format, model, agent_name=agent_name
                )
            )
        else:
            # Full mode without tools
            core_msgs = list(prompt_gptme(interactive, model, agent_name))
            if interactive:
                core_msgs.extend(prompt_user())
            core_msgs.extend(prompt_project())
            core_msgs.extend(prompt_systeminfo())
            core_msgs.extend(prompt_timeinfo())
            core_msgs.extend(prompt_skills_summary())
    elif prompt == "short":
        if include_tools:
            core_msgs = list(
                prompt_short(interactive, tools, tool_format, agent_name=agent_name)
            )
        else:
            core_msgs = list(prompt_gptme(interactive, model, agent_name))
    else:
        core_msgs = [Message("system", prompt)]
        if tools and include_tools:
            core_msgs.extend(prompt_tools(tools=tools, tool_format=tool_format))

    # TODO: generate context_cmd outputs seperately and put them last in a "dynamic context" section
    #       with context known not to cache well across conversation starts, so that cache points can be set before and better utilized/changed less frequently.
    #       probably together with chat history since it's also dynamic/live context.
    #       as opposed to static (core/system prompt) and semi-static (workspace/project prompt, like files).

    # Generate workspace messages separately (if included)
    workspace_msgs = (
        list(prompt_workspace(workspace))
        if include_workspace and workspace and workspace != agent_path
        else []
    )

    # Generate workspace context from agent if provided (if included)

Review comment (suggestion):
If there are no tools, how could it `"Load on-demand with `cat <path>`:\n"`, seems like skills only makes sense if tools are enabled. Remove it from the full mode with tools, and perhaps add this to a docstring to make it clear that skills are not for toolless runs.

Code after:
    )
    include_agent = effective_mode == "full" or (
        effective_mode == "selective" and "agent" in include_set
    )

    # Generate core system messages (without workspace context)
    core_msgs: list[Message]
    if effective_mode == "instructions-only":
        # Minimal mode: only basic gptme prompt
        core_msgs = list(prompt_gptme(interactive, model, agent_name))
    elif prompt == "full":
        if include_tools:
            core_msgs = list(
                prompt_full(
                    interactive, tools, tool_format, model, agent_name=agent_name
                )
            )
        else:
            # Full mode without tools
            # Note: skills summary is intentionally excluded here since skills
            # require tool access (e.g., `cat <path>`) to load on-demand
            core_msgs = list(prompt_gptme(interactive, model, agent_name))
            if interactive:
                core_msgs.extend(prompt_user())
            core_msgs.extend(prompt_project())
            core_msgs.extend(prompt_systeminfo())
            core_msgs.extend(prompt_timeinfo())
    elif prompt == "short":
        if include_tools:
            core_msgs = list(
                prompt_short(interactive, tools, tool_format, agent_name=agent_name)
            )
        else:
            core_msgs = list(prompt_gptme(interactive, model, agent_name))
    else:
        core_msgs = [Message("system", prompt)]
        if tools and include_tools:
            core_msgs.extend(prompt_tools(tools=tools, tool_format=tool_format))

    # TODO: generate context_cmd outputs seperately and put them last in a "dynamic context" section
    #       with context known not to cache well across conversation starts, so that cache points can be set before and better utilized/changed less frequently.
    #       probably together with chat history since it's also dynamic/live context.
    #       as opposed to static (core/system prompt) and semi-static (workspace/project prompt, like files).

    # Generate workspace messages separately (if included)
    workspace_msgs = (
        list(prompt_workspace(workspace))
        if include_workspace and workspace and workspace != agent_path
        else []
    )