Skip to content

feat(composer): add composer.yaml with per-context triggers and the moved status bar settings - #1948

Merged
edenreich merged 5 commits into
mainfrom
fix/issue-1947
Nov 23, 2026
Merged

edenreich merged 5 commits into
mainfrom
fix/issue-1947

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1947

Summary

The composer gets its own split file: composer.yaml loads as a sidecar under composer from the userspace and project layers. It holds the trigger table per context and the status bar settings, so the TUI and the desktop read one source via infer config get composer --format json. A trigger is any one special character, such as @, #, ^ or §. The status bar settings moved from chat.status_bar in config.yaml to status_bar in composer.yaml. A chat.status_bar block left in config.yaml is ignored, and the docs say to move it by hand.

Changes

  • config/composer.go: ComposerConfig with the triggers table (chat and room contexts, files, agents and issues sources) and the moved status_bar settings. A trigger is any one punctuation or symbol character, ASCII or not. Validation names composer.yaml and the offending key, so the reserved /, ! and !!, letters, digits, longer keys and unknown sources or contexts fail the load.
  • cmd/runtime: composer.yaml merges as a fatal sidecar with its trigger table validated before the merge. The default trigger table registers per context, so a context the file sets replaces that context's defaults (moving issues from # to ^ in chat turns # off there) while a context it leaves out keeps them.
  • cmd/init: seeds composer.yaml from the defaults.
  • cmd/config: infer config get composer (yaml/json) prints the resolved and validated composer section.
  • TUI: the autocomplete opens a menu for every trigger in the chat context's table, multi-byte ones included, and builds it in the configured section order, appending Markdown and built-in agents after the files. Every row keeps its own sigil. The status bar, git indicators, subagent linger and hot reload read composer.status_bar.
  • Docs: configuration-reference.md gains the Composer Settings section (triggers, replacing a trigger, reserved characters, the moved status bar and its INFER_COMPOSER_STATUS_BAR_* overrides). shortcuts-guide.md, cost-tracking.md, a2a-connections.md, tasks-management.md and the subagents example point at composer.yaml.
  • Tests: table tests cover the defaults and both contexts, custom and non-ASCII triggers, rejected triggers failing the load with the file and key named, a context replacing its defaults, both sidecar layers, the trigger menu order, sigils and splicing, infer init seeding and the config-get dump.

Follow-ups

…oved status bar settings

The composer trigger table and status bar toggles live in composer.yaml as a sidecar under composer, loaded from the userspace and project layers. Chat reproduces today's menu behavior with agents after files, room puts agents first. Slash and the bang sigils stay reserved and an unknown source or context fails the load naming composer.yaml and the key. The legacy chat.status_bar block from config.yaml still applies with a deprecation warning while composer.yaml sets no status_bar. The TUI and the hot-reload section read the moved settings.
…it on init

infer init seeds composer.yaml and moves a legacy chat.status_bar block from the regenerated config.yaml into its status_bar section. infer config get composer prints the resolved and validated composer section so the desktop reads one source. The TUI autocomplete now builds each trigger menu from the composer table of its chat context in the configured section order, appending Markdown and built-in agents after the files, while every row keeps its own sigil.
… init tests

The status bar settings now live only in composer.yaml. The runtime fallback for a
chat.status_bar block in config.yaml is removed along with its deprecation warning,
which never fired at startup since the config loads before the logger, and the
block move in infer init. A leftover block is ignored, and the docs say to move
it by hand and name the INFER_COMPOSER_STATUS_BAR_* env overrides.

The init tests the composer change had deleted are restored, and
TestInitializeProject now checks that init seeds composer.yaml. The duplicate
linger check leaves Config.Validate, the one-use tableKeysError wrapper is
inlined, the TUI passes the chat trigger table straight through, and the trigger
lists are unexported.
A trigger in composer.yaml was limited to @ and #, and the TUI matched only
those two hard-coded characters. A trigger is now any one punctuation or symbol
character, ASCII or not, such as ^ or §. The reserved /, ! and !! still fail the
load, as do letters, digits and longer keys, which would open a menu on
ordinary typing.

The TUI opens a menu for every trigger in the context's table and reads the
query after the whole trigger character, so a multi-byte one such as § works.

The default trigger table now registers per context instead of per trigger. A
context set in composer.yaml replaces that context's defaults, so moving issues
from # to ^ in chat turns # off there, while a context the file leaves out
keeps its defaults.
@edenreich
edenreich merged commit 3a6b53b into main Nov 23, 2026
14 checks passed
@edenreich
edenreich deleted the fix/issue-1947 branch November 23, 2026 17:07
@edenreich edenreich moved this from Todo to Done in 2026 Nov 23, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.267.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 23, 2026
edenreich added a commit that referenced this pull request Nov 23, 2026
…while filtering (#1953)

Follow-up to #1948 from a review of the merged composer change.

## Summary

Two display bugs in the composer trigger menus, plus cleanups the review
found.

- A menu that lists files pads the path column to the full width. The
agent rows #1948 added to the default chat `@` menu then appended their
description past it, so a row was 103 columns wide in an 80-column menu.
Every user hits this, since built-in agents always exist. Menus that
list files now render no description column.
- The fuzzy filter rebuilt rows from the shortcut alone, so issue titles
and agent descriptions disappeared after the first keystroke in a
composed menu. It now keeps the original row and only adds the match
offsets.

## Changes

- `autocomplete.go`: the render and filter fixes above. The chat trigger
defaults are set once in `NewAutocomplete`, replacing the
`triggerTable`/`composerSources` fallback that built a whole
`DefaultComposerConfig()` per keystroke when unset.
- `config/composer.go`: `ValidateComposerTriggers` checks a trigger
table on its own, and `Validate` calls it before the linger check. The
known contexts and sources live in one list each. The test-only
`ComposerConfig.TriggerSources` is removed.
- `cmd/runtime/config.go`: the pre-merge hook decodes the table with
mapstructure. A malformed table now names its key (`'[chat][^]' source
data must be an array or slice, got string`) instead of a line number
from a re-marshaled document that pointed at the wrong line.
- `cmd/config/getset.go`: the three YAML-to-map round-trips share one
`yamlMap` helper.
- Smaller cleanups:
  - variables named `context` renamed to `scope`
- the duplicate `writeTestHomeFile` replaced by the existing
`writeHomeFile`
- a reflection test of `ChatConfig`'s shape removed, since the compiler
covers it
  - stale doc comments fixed
- Docs: `configuration-reference.md` says the home and project
`composer.yaml` merge per trigger, so a project file cannot remove a
trigger the home file sets.

## Tests

- `TestTriggerMenuFitsItsWidth`: every row of the default `@` menu fits
an 80-column width. It failed before the fix with a 103-column row.
- `TestComposedMenuKeepsDescriptionsWhileFiltering`: a filtered `^` menu
of agents and issues still shows the agent description. It failed before
the fix.
- Checked by hand in the chat TUI with `INFER_GATEWAY_MOCK=true` in an
80-column tmux pane: `@` lists the files, and `@explore` shows the agent
row among them, all within the width.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] composer.yaml: the composer's trigger characters per context and its status bar settings

1 participant