feat(integrations): multi-account support with aliases#370
Open
AlanAAG wants to merge 2 commits into
Open
Conversation
…tion, and reliable natural-language routing
* feature/chat questionaire * bug fixes and corrections * fix: harden clarifying-questions flow per PR #377 review - Error instead of parking 3h when no UI can answer (CLI mode / no clients), via new InterfaceAdapter.can_prompt_user() - Drop duplicate submits from stale tabs (atomic first-submission-wins in storage) and broadcast resolution to all clients - QuestionStepper: structured per-question drafts (comma values no longer corrupt on back-nav), selected-choice highlight, Dismiss button, Esc in free-text clears instead of declining - Resume text falls back to storage after restart (no more raw "q1" ids) - Dedupe question serializers into ChatMessageQuestion to_dict/from_dict - Extract WAIT_FOR_REPLY_PARK_DELAY_SECONDS (imported inside action bodies - executor exec()s function source only) --------- Co-authored-by: ahmad-ajmal <ahmadajmal1514@gmail.com>
Collaborator
|
@AlanAAG You can remove Outlook for verification. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google Drive, Google Docs, YouTube, Outlook, LinkedIn, Notion, HubSpot,
and Slack. Each can hold more than one connected account, with a
user-assignable nickname (alias) and a designated primary account.
craftos_integrations/accounts.py) handles listing,resolving (by exact identity, alias, or unique substring), aliasing,
and promoting/demoting primary — built once, reused by all 10
integrations rather than reimplemented per-service.
the same account instead of prompting a chooser (missing
select_account/prompt=loginparams). Fixed per-provider.account — set a nickname once on Gmail and it applies to Calendar,
Drive, Docs, and YouTube automatically. Existing per-service aliases
migrate transparently.
accountparameter, defaulting to the primary account when omitted.Includes closing a gap found during testing: LinkedIn's 10 social/write
actions (
create_linkedin_post, likes, comments, DMs, follow) used adifferent dispatch path that never accepted
account— now fixed andverified (intercepted the real HTTP call to confirm the correct
account's token is used).
locally; nothing is written until "Save changes" is clicked, or
discarded on modal close. "Add account" is the one exception — it's a
real external OAuth grant and applies immediately.
agent_core/core/prompts/action.py,AGENT.md, all 10 integrations'INTEGRATION.md) to explicitly directthe agent to extract account qualifiers from natural language ("my
school calendar") rather than silently defaulting to primary.
(
_integration_essentials.py): bare words like "calendar"/"docs"/"drive"/"youtube" never matched anything (only the full "google X"
form did), so the per-integration guidance never reached the model
for the most natural phrasing.
Test plan
tests/test_accounts_generic.py(integration-agnosticlayer, tested against a synthetic credential shape) and
tests/test_google_multi_account.py(Google-specific behavior,legacy alias migration)
unrelated failures untouched)
write actions (Gmail draft, Google Doc) correctly scoped to the
targeted account by alias, with real Google 404/403 responses
confirming true cross-account isolation
and confirming the correct account's bearer token was used
correctly triggers Calendar-specific guidance (didn't before);
confirmed "lark calendar" still resolves correctly alongside it
real accounts (only simulated/seeded credentials tested for these)
account qualifiers from natural language per the strengthened
prompts — the code/prompt delivery side is verified, but actual
model compliance can only be confirmed by using it
closes issue #368