Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
4e4f105
Add custom subdomain support for OpenAI and Speech Service in Terraform
Jan 2, 2026
be56540
Merge branch 'Development' of https://github.com/vivche/simplechat-de…
Jan 7, 2026
e13ba0c
Merge remote-tracking branch 'upstream/Development' into Development
Jan 23, 2026
087fb3d
feat: Add ServiceNow integration documentation and bug fixes
Jan 23, 2026
502355f
Removed the readme files for bug fix details
Jan 24, 2026
33bee68
Updated servicenow integration readme
Jan 24, 2026
cd8c520
chore: Revert custom logo changes to upstream version
Jan 24, 2026
fb8181b
chore: Revert terraform main.tf to upstream version
Jan 24, 2026
660d76c
Removed the two openai sample spec downloaed from servicennow site
Jan 24, 2026
de866eb
Update docs/how-to/agents/ServiceNow/servicenow_agent_instructions.txt
vivche Jan 24, 2026
20f994a
Update docs/how-to/agents/ServiceNow/open_api_specs/sample_servicenow…
vivche Jan 24, 2026
351f143
Update docs/how-to/azure_speech_managed_identity_manul_setup.md
vivche Jan 24, 2026
5fe5b14
Update application/single_app/semantic_kernel_plugins/openapi_plugin_…
vivche Jan 24, 2026
9626219
Checked in the bug fix detail readme to docs/explanation/fixes/v0.236…
Jan 24, 2026
6364827
Merge branch 'servicenow-integration' of https://github.com/vivche/si…
Jan 24, 2026
dce54a1
Added version number to the feature readme files
Jan 24, 2026
8353d77
Added version number to document, and removed redudant import statement
Jan 24, 2026
5aa7007
refactor: use _ for intentionally unused variable in AI Search test
Jan 24, 2026
548d8d8
Removed azure_speech_managed_indeity_manual readme file since it is u…
Jan 24, 2026
62b0b5b
update version numbers to 0.236.012 in bug fix documentation
Jan 24, 2026
b0be501
Update application/single_app/semantic_kernel_loader.py
vivche Jan 24, 2026
e264a13
Update docs/how-to/agents/ServiceNow/open_api_specs/sample_now_knowle…
vivche Jan 24, 2026
b04bd67
Update docs/explanation/fixes/v0.236.012/AZURE_AI_SEARCH_TEST_CONNECT…
vivche Jan 24, 2026
84c01e9
Update docs/how-to/agents/ServiceNow/open_api_specs/sample_now_knowle…
vivche Jan 24, 2026
c8e383e
Update docs/how-to/agents/ServiceNow/open_api_specs/sample_servicenow…
vivche Jan 24, 2026
39dc7a4
Update docs/explanation/fixes/v0.236.012/GROUP_AGENT_LOADING_FIX.md
vivche Jan 24, 2026
2e8c737
Remvoed debug statements that might include senstive info
Jan 24, 2026
d0581d5
Merge branch 'servicenow-integration' of https://github.com/vivche/si…
Jan 24, 2026
0c23a78
Rollback Azure AI Search test connection fix for separate PR
Jan 24, 2026
7f8248a
Update application/single_app/semantic_kernel_plugins/openapi_plugin_…
vivche Jan 24, 2026
a0fbffd
Update docs/explanation/fixes/v0.236.012/GROUP_AGENT_LOADING_FIX.md
vivche Jan 24, 2026
4bac07a
Update docs/explanation/fixes/v0.236.012/GROUP_ACTION_OAUTH_SCHEMA_ME…
vivche Jan 24, 2026
1c31db4
Update docs/how-to/agents/ServiceNow/SERVICENOW_OAUTH_SETUP.md
vivche Jan 24, 2026
7e0c688
Fix Azure AI Search test connection with managed identity
Jan 24, 2026
6b0164a
Fix Azure AI Search test connection with managed identity
Jan 24, 2026
c910ede
Corrected file folder name
Jan 24, 2026
f188224
Merge branch 'ai-search-test-connection-fix' of https://github.com/vi…
Jan 24, 2026
8ae8518
Corrected the version number to reference 0.236.012
Jan 24, 2026
a82ecb7
Removed unneeded folder and document
Jan 24, 2026
589291b
Revert terraform main.tf to upstream/Development version
Jan 24, 2026
d017028
updated the logging logic when running retention delete with archivin…
paullizer Jan 24, 2026
2e8e87a
Corrected version to 0.236.011 (#645)
paullizer Jan 26, 2026
6042461
v0.237.001 (#649)
paullizer Jan 26, 2026
9c698af
Merge branch 'Staging' into Development
paullizer Jan 26, 2026
84e00cb
Use Microsoft python base image
clarked-msft Jan 26, 2026
317c6ee
Add python ENV vars
clarked-msft Jan 26, 2026
25f41fb
Add python ENV vars
clarked-msft Jan 26, 2026
0753f52
Install deps to systme
clarked-msft Jan 26, 2026
f2958f0
Add temp dir to image and pip conf support
clarked-msft Jan 26, 2026
efd6fe7
Add custom-ca-certificates dir
clarked-msft Jan 26, 2026
231b792
Merge pull request #653 from clarked-msft/msft-python-image
Bionic711 Jan 26, 2026
7d0a792
Logo bug fix (#654)
paullizer Jan 26, 2026
1cdb27a
Merge branch 'Staging' into Development
paullizer Jan 26, 2026
823e6fa
Rentention policy (#657)
paullizer Jan 26, 2026
1c1c845
Merge branch 'Staging' into Development
paullizer Jan 26, 2026
31e8341
Added ServiceNow support for create and publish article. Including r…
Jan 27, 2026
c70db6b
Replace actual servicenow instance name with generic name in the read…
Jan 27, 2026
fa72a65
Merge remote-tracking branch 'upstream/Development' into servicenow-i…
Jan 27, 2026
0ed07b1
Changed version number in ServiceNow readme files to 0.237.005 since …
Jan 27, 2026
61d8a8b
Enhance ServiceNow agent for managing new KB article creation
Jan 28, 2026
715bb6b
Added readme and open ai specs and agent instructions to support Serv…
Jan 28, 2026
b5804ad
Remove any references to actual ServiceNow instances
Jan 28, 2026
6c4b14e
Merge upstream/Development into ai-search-test-connection-fix
Jan 28, 2026
7ace8b7
Merge pull request #641 from vivche/ai-search-test-connection-fix
Bionic711 Jan 29, 2026
05a14e4
fixed retention policy runtime bug and sidebar bug (#672)
paullizer Jan 30, 2026
5cd0f3b
Merge branch 'Staging' into Development
paullizer Jan 30, 2026
0e0c437
Fix: Windows Unicode encoding issue for video uploads (#662)
vivche Jan 30, 2026
ab456a4
Update docs/how-to/azure_speech_managed_identity_manul_setup.md (#675)
paullizer Jan 30, 2026
534eb72
Add custom subdomain support for OpenAI and Speech Service in Terrafo…
vivche Jan 30, 2026
251b949
0.237.006 (#676)
paullizer Jan 30, 2026
cd09c7a
docs: Update release notes for ServiceNow integration and bug fixes
Jan 30, 2026
634040d
Update release_notes.md
paullizer Jan 30, 2026
944b581
Merge branch 'Staging' into Development
paullizer Jan 30, 2026
39e812c
resolve conflict
Jan 30, 2026
0da710a
fixed sidebar race condition (#679)
paullizer Jan 30, 2026
1e4b524
Merge branch 'Staging' into Development
paullizer Jan 30, 2026
fd66132
Merge branch 'Development' into servicenow-integration, and moved fix…
Jan 31, 2026
0c161ae
fix the version number in config.py
Jan 31, 2026
bf90baf
Security: Restrict group agent loading to active group only
Jan 31, 2026
8a9ad98
Fixed an instruction error that caused semantic kernel to fall back t…
Jan 31, 2026
28a557e
Merge pull request #640 from vivche/servicenow-integration
Bionic711 Jan 31, 2026
82f8a89
Fixed! The issue was caused by duplicated code blocks (#683)
paullizer Feb 3, 2026
4c24cc8
Manage group frontend bug (#684)
paullizer Feb 3, 2026
b66bee9
initial feature add
paullizer Feb 4, 2026
ef5f468
added tag endpoint
paullizer Feb 4, 2026
af15c05
return unused tags too
paullizer Feb 4, 2026
ef14203
Bicepfix (#690)
eldong Feb 5, 2026
296d987
working on ui
paullizer Feb 5, 2026
a4a4224
Search bug fix 20260229 (#697)
paullizer Feb 9, 2026
541dd60
Overhauled and updated file extension definition & MAG audio file tra…
Xeelee33 Feb 9, 2026
7c2eb0c
Update release_notes.md (#698)
paullizer Feb 9, 2026
e102efe
Merge branch 'Staging' into Development
paullizer Feb 9, 2026
2429489
removed duplicate code causing bugs (#701)
paullizer Feb 9, 2026
b529d60
Chat file upload error (#709)
paullizer Feb 11, 2026
0cd14b9
Merge branch 'Staging' into Development
paullizer Feb 11, 2026
7381359
edit folders
paullizer Feb 18, 2026
66f9287
sorting fixed
paullizer Feb 18, 2026
654739a
chat with working with personal
paullizer Feb 19, 2026
3daf815
tagging added to groups and public workspaces
paullizer Feb 20, 2026
e317139
added tags to group and public workspace
paullizer Feb 22, 2026
6d9e6b0
fixed tags in group and public workspaces
paullizer Feb 23, 2026
978ca4f
Update .gitignore
paullizer Feb 23, 2026
de3a523
fixed citation bug
paullizer Feb 23, 2026
4befb2c
cleaned up workspaces
paullizer Feb 23, 2026
47d07da
Bugfix/globalagentscreation (#720)
Bionic711 Feb 23, 2026
f36f990
Add Dockerfile and update devcontainer configuration for Python envir…
SteveCInVA Feb 23, 2026
dc746a4
extended document dropdown width
paullizer Feb 23, 2026
b256a07
Update chat-documents.js
paullizer Feb 23, 2026
b74c077
Create CLAUDE.md
paullizer Feb 23, 2026
8168bb1
added features and updated release notes
paullizer Feb 23, 2026
59e8297
Added ability for admin to disable/enable workspace lock
paullizer Feb 23, 2026
deae525
Merge branch 'Development' into workspace-folders
paullizer Feb 23, 2026
e0da096
Add tags to blob metadata when enhanced citations is enabled
paullizer Feb 23, 2026
edcce6d
Merge branch 'workspace-folders' of https://github.com/microsoft/simp…
paullizer Feb 23, 2026
f78e8a5
Fix/agent action 500 error (#731)
paullizer Feb 23, 2026
b92ec5a
Update release_notes.md
paullizer Feb 23, 2026
a924a30
Merge branch 'workspace-folders' into Development
paullizer Feb 23, 2026
3100d85
optional only allow owner to create/edit/delete group agents and actions
paullizer Feb 24, 2026
d3667b2
Merge pull request #736 from microsoft/feature/owner-required-to-crea…
Bionic711 Feb 24, 2026
9e29f22
Added retention policy UI for groups and public workspaces (#730)
eldong Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu
# Install the xz-utils package
RUN apt-get update && apt-get install -y xz-utils
20 changes: 14 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
//"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "3.11"
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest"
Expand All @@ -14,18 +21,16 @@
"installBicep": true,
"installUsingPython": true,
"version": "2.72.0",
"bicepVersion": "latest"
"bicepVersion": "latest"
},
"ghcr.io/devcontainers/features/terraform:1": {},
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/azure/azure-dev/azd:latest": {}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r application/single_app/requirements.txt",
"postCreateCommand": "python3 -m venv .venv && .venv/bin/pip install -r application/single_app/requirements.txt",
// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand All @@ -36,7 +41,10 @@
"ms-vscode.azurecli",
"HashiCorp.terraform",
"ms-vscode.powershell"
]
],
"settings": {
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python"
}
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ flask_session
**/my_chart.png
**/sample_pie.csv
**/sample_stacked_column.csv
tmp**cwd
tmp_images
nul
160 changes: 160 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# SimpleChat — Project Instructions

SimpleChat is a Flask web application using Azure Cosmos DB, Azure AI Search, and Azure OpenAI. It supports personal, group, and public workspaces for document management and AI-powered chat.

## Code Style — Python

- Start every file with a filename comment: `# filename.py`
- Place imports at the top, after the module docstring (exceptions must be documented)
- Use 4-space indentation, never tabs
- Use `log_event` from `functions_appinsights.py` for logging instead of `print()`

## Code Style — JavaScript

- Start every file with a filename comment: `// filename.js`
- Group imports at the top of the file (exceptions must be documented)
- Use 4-space indentation, never tabs
- Use camelCase for variables and functions: `myVariable`, `getUserData()`
- Use PascalCase for classes: `MyClass`
- Never use `display:none` in JavaScript; use Bootstrap's `d-none` class instead
- Use Bootstrap alert classes for notifications, not `alert()` calls

## Route Decorators — Swagger Security

**Every Flask route MUST include the `@swagger_route(security=get_auth_security())` decorator.**

- Import `swagger_route` and `get_auth_security` from `swagger_wrapper`
- Place `@swagger_route(security=get_auth_security())` immediately after the `@app.route(...)` decorator and before any authentication decorators (`@login_required`, `@user_required`, etc.)
- This applies to all new and existing routes — no exceptions

Correct pattern:
```python
from swagger_wrapper import swagger_route, get_auth_security

@app.route("/api/example", methods=["GET"])
@swagger_route(security=get_auth_security())
@login_required
@user_required
def example_route():
...
```

## Security — Settings Sanitization

**NEVER send raw settings or configuration data to the frontend without sanitization.**

- Always use `sanitize_settings_for_user()` from `functions_settings.py` before passing settings to `render_template()` or `jsonify()`
- **Exception**: Admin routes should NOT be sanitized (breaks admin features)
- Sanitization strips: API keys, Cosmos DB connection strings, Azure Search admin keys, Document Intelligence keys, authentication secrets, internal endpoint URLs, database credentials, and any field containing "key", "secret", "password", or "connection"

Correct pattern:
```python
from functions_settings import get_settings, sanitize_settings_for_user

settings = get_settings()
public_settings = sanitize_settings_for_user(settings)
return render_template('page.html', settings=public_settings)
```

## Version Management

- Version is stored in `config.py`: `VERSION = "X.XXX.XXX"`
- When incrementing, only change the third segment (e.g., `0.238.024` -> `0.238.025`)
- Include the current version in functional test file headers and documentation files

## Documentation Locations

- **Feature documentation**: `docs/explanation/features/[FEATURE_NAME].md` (uppercase with underscores)
- **Fix documentation**: `docs/explanation/fixes/[ISSUE_NAME]_FIX.md` (uppercase with underscores)
- **Release notes**: `docs/explanation/release_notes.md`

### Feature Documentation Structure

1. Header: title, overview, version, dependencies
2. Technical specifications: architecture, APIs, configuration, file structure
3. Usage instructions: enable/configure, workflows, examples
4. Testing and validation: coverage, performance, limitations

### Fix Documentation Structure

1. Header: title, issue description, root cause, version
2. Technical details: files modified, code changes, testing, impact
3. Validation: test results, before/after comparison

## Release Notes

After completing code changes, offer to update `docs/explanation/release_notes.md`.

- Add entries under the current version from `config.py`
- If the version was bumped, create a new section at the top: `### **(vX.XXX.XXX)**`
- Entry categories: **New Features**, **Bug Fixes**, **User Interface Enhancements**, **Breaking Changes**
- Format each entry with a bold title, bullet-point details, and a `(Ref: ...)` line referencing relevant files/concepts

## Functional Tests

- **Location**: `functional_tests/`
- **Naming**: `test_{feature_area}_{specific_test}.py` or `.js`
- **When to create**: bug fixes, new features, API changes, database migration, UI/UX changes, authentication/security changes

Every test file must include a version header:
```python
#!/usr/bin/env python3
"""
Functional test for [feature/fix name].
Version: [current version from config.py]
Implemented in: [version when fix/feature was added]

This test ensures that [description of what is being tested].
"""
```

Test template pattern:
```python
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

def test_primary_functionality():
"""Test the main functionality."""
print("Testing [Feature Name]...")
try:
# Setup, execute, validate, cleanup
print("Test passed!")
return True
except Exception as e:
print(f"Test failed: {e}")
import traceback
traceback.print_exc()
return False

if __name__ == "__main__":
success = test_primary_functionality()
sys.exit(0 if success else 1)
```



## Key Project Files

| File | Purpose |
|------|---------|
| `application/single_app/config.py` | App configuration and `VERSION` |
| `application/single_app/functions_settings.py` | `get_settings()`, `sanitize_settings_for_user()` |
| `application/single_app/functions_appinsights.py` | `log_event()` for logging |
| `application/single_app/functions_documents.py` | Document CRUD, chunk operations, tag management |
| `application/single_app/functions_group.py` | Group workspace operations |
| `application/single_app/functions_public_workspaces.py` | Public workspace operations |
| `application/single_app/route_backend_documents.py` | Personal document API routes |
| `application/single_app/route_backend_group_documents.py` | Group document API routes |
| `application/single_app/route_external_public_documents.py` | Public document API routes |
| `application/single_app/route_backend_chats.py` | Chat API routes and AI search integration |

## Frontend Architecture

- Templates: `application/single_app/templates/` (Jinja2 HTML)
- Static JS: `application/single_app/static/js/`
- `chat/` — Chat interface modules (chat-messages.js, chat-documents.js, chat-citations.js, chat-streaming.js)
- `workspace/` — Personal workspace (workspace-documents.js, workspace-tags.js)
- `public/` — Public workspace (public_workspace.js)
- Group workspace JS is inline in `templates/group_workspaces.html`
- Uses Bootstrap 5 for UI components and styling
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.237.009"
VERSION = "0.238.024"

SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')

Expand Down
54 changes: 54 additions & 0 deletions application/single_app/functions_activity_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,60 @@ def log_web_search_consent_acceptance(
debug_print(f"Error logging web search consent acceptance for user {user_id}: {str(e)}")


def log_index_auto_fix(
index_type: str,
missing_fields: list,
user_id: str = 'system',
admin_email: Optional[str] = None
) -> None:
"""
Log automatic Azure AI Search index field fixes to activity_logs and App Insights.

Args:
index_type (str): Type of index fixed ('user', 'group', or 'public').
missing_fields (list): List of field names that were added.
user_id (str, optional): User ID triggering the fix. Defaults to 'system'.
admin_email (str, optional): Admin email if triggered by admin.
"""
try:
activity_record = {
'id': str(uuid.uuid4()),
'activity_type': 'index_auto_fix',
'user_id': user_id,
'timestamp': datetime.utcnow().isoformat(),
'created_at': datetime.utcnow().isoformat(),
'index_type': index_type,
'missing_fields': missing_fields,
'fields_added': len(missing_fields),
'trigger': 'automatic',
'description': f"Automatically added {len(missing_fields)} missing field(s) to {index_type} index: {', '.join(missing_fields)}"
}

if admin_email:
activity_record['admin_email'] = admin_email

cosmos_activity_logs_container.create_item(body=activity_record)

log_event(
message=f"Auto-fixed {index_type} index: added {len(missing_fields)} field(s)",
extra=activity_record,
level=logging.INFO
)
debug_print(f"Logged index auto-fix for {index_type} index: {', '.join(missing_fields)}")

except Exception as e:
log_event(
message=f"Error logging index auto-fix: {str(e)}",
extra={
'user_id': user_id,
'index_type': index_type,
'error': str(e)
},
level=logging.ERROR
)
debug_print(f"Error logging index auto-fix for {index_type}: {str(e)}")


def log_document_upload(
user_id: str,
container_type: str,
Expand Down
25 changes: 24 additions & 1 deletion application/single_app/functions_conversation_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,30 @@ def collect_conversation_metadata(user_message, conversation_id, user_id, active
}
current_tags[semantic_key] = semantic_tag # Update the tags array
conversation_item['tags'] = list(current_tags.values())


# --- Scope Lock Logic ---
current_scope_locked = conversation_item.get('scope_locked')

if document_map:
# Always update locked_contexts when search results exist (even if unlocked)
# This ensures re-locking uses the most up-to-date workspace list
locked_set = set()
for ctx in conversation_item.get('context', []):
if ctx.get('scope') != 'model_knowledge' and ctx.get('type') in ('primary', 'secondary'):
locked_set.add((ctx['scope'], ctx.get('id')))

# Merge with existing locked_contexts
for ctx in conversation_item.get('locked_contexts', []):
locked_set.add((ctx.get('scope'), ctx.get('id')))

conversation_item['locked_contexts'] = [
{"scope": s, "id": i} for s, i in locked_set if s and i
]

# Only auto-lock the FIRST time (from null state)
if current_scope_locked is None:
conversation_item['scope_locked'] = True

return conversation_item


Expand Down
Loading
Loading