Skip to content

Issue 444 Teams Package Self Test And Thinking Models

Ed Mozley edited this page Nov 28, 2026 · 1 revision

Teams package refused, self-test failing, empty AI answers (issue #444)

Reported in #444 by @medium00rare-art - FreeITSM 5.11.0 in Docker, a single-tenant Azure Bot behind a Cloudflare Tunnel, AI through the custom OpenAI-compatible endpoint pointed at Ollama serving a qwen3 model. Fixed for 5.12.0.

The report listed six things. Four were bugs and are fixed here; two are feature ideas, answered on the issue.

# What you saw Fixed
1 Teams refused the app package: Schema validation failed at 'packageName' yes
2 Test connection: Inbound handling - no usable sender identifier, though real messages worked yes
3 The AI returned an empty summary / could not draft a reply with a thinking model, while the AI Test passed yes
4 Teams replies show the bot, not the analyst who wrote them a feature - see the issue
5 Raw ids on screen: Name <a:1K_...>, and a long conversation URL in To: yes
6 Hard to tell whether a message adds to an old ticket or opens a new one (cards suggested) a feature - see the issue

1. The package: one property too many

FreeITSM's manifest.json declares schema 1.17, and that schema says additionalProperties: false at the top level. packageName is not one of its properties - it belonged to the old 1.x schemas - so a single unknown key failed the whole upload. Teams was right.

// includes/messaging/TeamsPackage.php - the line that went
'packageName' => 'com.freeitsm.' . strtolower(preg_replace('/[^a-z0-9]+/i', '', $appId)),

Test: tests/teams-manifest.php builds the real package (an in-memory SQLite stands in for the database) and checks the manifest against the 1.17 schema's own rules, copied from Microsoft's published schema: every object's allowed and required keys, the length limits, the scopes and permissions, https links. The control: the manifest as it was, with packageName, fails the same check.

2. The self-test's made-up sender

Inbound handling pushes a made-up message through the real ingest, which first runs the sender through normaliseChannelIdentifier() - one rule per channel type. The self-test always sent a phone-shaped sender (+99999...) except to Telegram, which had been fixed the same way in #159. A Teams conversation id cannot start with +.

It was three channels, not one: Teams, Slack and Mattermost all failed this way. messagingSelfTestSender() (includes/messaging/messaging.php) now makes a sender in each platform's real shape, and ingest no longer asks Teams or Mattermost who the made-up sender is.

Tests: tests/messaging-self-test-sender.php runs every type's fake sender through the real rule (the control: the old phone-shaped one is refused by Teams, Slack and Mattermost). And on a test install, the real Inbound handling check on a Teams channel: passes, and with the old sender put back, fails with exactly the reported error.

3. Models that think before answering

See AI providers Β§ Asked again, with room to think. A thinking model spent the Teams summary's 400 tokens on reasoning and wrote nothing; every feature now gets one retry with room, then a real explanation. This is in the shared aiProviderChat(), so it covers every AI feature, not only Teams.

5. Ids that are not addresses

senderLabel() (assets/js/inbox.js) put whatever was in the address field in angle brackets. On a chat ticket that is the platform's id or FreeITSM's placeholder (...@teams.local). addressWorthShowing() now allows only an email address or a phone number (with its +); anything else shows the name alone - and a contact with no name still shows the id, never a blank. The long To: conversation URL went with the ticket header rework, which no longer shows one message's To.

Test: tests/chat-sender-labels.php runs the shipped functions in Chrome: Teams, Slack and Telegram ids beside a name show the name; an email address, a phone number and a nameless contact still show as before.

What is not proven

None of this was run against Microsoft's own Teams here - there is no Teams tenant on the development machine. The manifest is checked against the published schema, and the self-test against the real FreeITSM code; the reporter's environment, or a one-person test tenant, is where it is confirmed.


See also: Microsoft Teams channel Β· AI providers Β· Bugs resolved

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally