Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat: take New session out of the / menu

leepokaif67bfa5bab86
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MessageComposer.kt b/apps/android/app/src/main/kotlin/com/codync/android/MessageComposer.kt
index d7b76a53..b1df45c6 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/MessageComposer.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/MessageComposer.kt
@@ -141,8 +141,7 @@ private enum class Trailing { Interrupt, Stop, Call, Send }
val skill = command.skill
when {
skill != null -> text.setTextAndPlaceCursorAtEnd("/$skill ")
- command.name == "fast" -> { store.command("updateBot", buildJsonObject { put("id", bot.id); put("fastMode", !bot.fastMode) }, "roster:" + bot.id); clear() }
- else -> { store.command("newSession", body("botId" to bot.id)); clear() }
+ else -> { store.command("updateBot", buildJsonObject { put("id", bot.id); put("fastMode", !bot.fastMode) }, "roster:" + bot.id); clear() }
}
}
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/SlashCommands.kt b/apps/android/app/src/main/kotlin/com/codync/android/SlashCommands.kt
index b20b42f5..99d6f9db 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/SlashCommands.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/SlashCommands.kt
@@ -28,13 +28,13 @@ import com.codync.android.design.*
import com.kyant.shapes.Capsule
import com.kyant.shapes.RoundedRectangle
-/** A command in the composer's `/` list (iOS `SlashCommand`): Fast mode, New session, or one of the bot's skills. */
+/** A command in the composer's `/` list (iOS `SlashCommand`): Fast mode, or one of the bot's skills. */
internal data class SlashCommand(val name: String, val icon: String, val title: String, val detail: String, val warning: Boolean,
val skill: String? = null)
/**
* The composer's `/` commands, listed while the draft is just `/partial` (iOS `SlashCommands`): Fast mode
- * and New session run here; a skill fills in `/<id> `, which the host turns into "read this skill first".
+ * runs here (a new session is in the bot's menu); a skill fills in `/<id> `, which the host turns into "read this skill first".
*/
internal object SlashCommands {
/** The first host that understands `/skill` messages; older ones get the text as typed. */
@@ -51,13 +51,12 @@ internal object SlashCommands {
return (builtIn(bot) + own).filter { query.isEmpty() || it.name.contains(query, true) || it.title.contains(query, true) }
}
- /** A draft that is just a built-in command (`/fast`, `/new`): sending it runs the command. */
+ /** A draft that is just a built-in command (`/fast`): sending it runs the command. */
fun builtIn(bot: Bot, draft: String): SlashCommand? = query(draft.trim())?.let { name -> builtIn(bot).firstOrNull { it.name == name } }
private fun builtIn(bot: Bot): List<SlashCommand> = if (bot.kind == "group") emptyList() else buildList {
if (bot.fastModeShown) add(SlashCommand("fast", "bolt", "Fast mode", bot.fastModeRefusal
?: if (bot.fastMode) "Turn off and return to standard speed" else "Turn on for faster replies and more usage", bot.fastModeRefusal != null))
- add(SlashCommand("new", "arrow.counterclockwise", "New session", "Start over with a fresh context; the transcript stays", false))
}
}
diff --git a/apps/android/app/src/test/kotlin/com/codync/android/SlashCommandsTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/SlashCommandsTest.kt
index ac55439a..d503fd20 100644
--- a/apps/android/app/src/test/kotlin/com/codync/android/SlashCommandsTest.kt
+++ b/apps/android/app/src/test/kotlin/com/codync/android/SlashCommandsTest.kt
@@ -12,9 +12,9 @@ class SlashCommandsTest {
assertNull(SlashCommands.query("hi /new"))
val bot = Bot("b", "Bot", skills = listOf("review"))
val skills = listOf(InstalledSkill("review", "Review", "Reads diffs", "src", "/p"), InstalledSkill("other", "Other", "", "src", "/q"))
- assertEquals(listOf("new", "review"), SlashCommands.list(bot, "", skills, "2.14.1").map { it.name }.filter { it != "fast" })
- assertEquals(listOf("new"), SlashCommands.list(bot, "", skills, "2.9.3").map { it.name }.filter { it != "fast" })
- assertEquals("new", SlashCommands.builtIn(bot, " /new ")?.name)
+ assertEquals(listOf("review"), SlashCommands.list(bot, "", skills, "2.14.1").map { it.name }.filter { it != "fast" })
+ assertEquals(emptyList<String>(), SlashCommands.list(bot, "", skills, "2.9.3").map { it.name }.filter { it != "fast" })
+ assertNull("a new session is in the bot's menu", SlashCommands.builtIn(bot, " /new "))
assertTrue(SlashCommands.list(Bot("g", "Team", kind = "group"), "", skills, null).isEmpty())
}
diff --git a/apps/desktop/src/renderer/views/thread/Composer.tsx b/apps/desktop/src/renderer/views/thread/Composer.tsx
index b5ae80a5..d1e3b490 100644
--- a/apps/desktop/src/renderer/views/thread/Composer.tsx
+++ b/apps/desktop/src/renderer/views/thread/Composer.tsx
@@ -118,10 +118,6 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {
store.setFastMode(bot, !bot.fastMode)
setDraft('')
break
- case 'newSession':
- store.newSession(bot.id)
- setDraft('')
- break
case 'skill':
setDraft(`/${command.action.id} `)
break
diff --git a/apps/desktop/src/renderer/views/thread/slash-commands.test.ts b/apps/desktop/src/renderer/views/thread/slash-commands.test.ts
index 3a54959e..ca7c522c 100644
--- a/apps/desktop/src/renderer/views/thread/slash-commands.test.ts
+++ b/apps/desktop/src/renderer/views/thread/slash-commands.test.ts
@@ -18,27 +18,27 @@ test('a leading slash opens the list until the name ends', () => {
test('built-in commands come first, then only the bot\'s own skills, by name or title', () => {
const bot = normalizeBot({ id: 'b', skills: ['pdf', 'code-review'], fastModeSupport: 'offered' })
- assert.deepEqual(slashCommands(bot, '', installed).map((c) => c.name), ['fast', 'new', 'pdf', 'code-review'])
+ assert.deepEqual(slashCommands(bot, '', installed).map((c) => c.name), ['fast', 'pdf', 'code-review'])
assert.deepEqual(slashCommands(bot, 'review', installed).map((c) => c.name), ['code-review'])
- assert.deepEqual(slashCommands(bot, 'session', installed).map((c) => c.name), ['new'])
+ assert.deepEqual(slashCommands(bot, 'new', installed), [], 'a new session is in the bot\'s menu')
assert.deepEqual(slashCommands(normalizeBot({ id: 'b', skills: ['pdf'] }), 'xl', installed), [])
- assert.deepEqual(slashCommands(normalizeBot({ id: 'b' }), '', []).map((c) => c.name), ['fast', 'new'], 'offered until the agent says otherwise')
- assert.deepEqual(slashCommands(normalizeBot({ id: 'b', fastModeSupport: 'unsupported' }), '', []).map((c) => c.name), ['new'], 'no Fast mode on offer')
+ assert.deepEqual(slashCommands(normalizeBot({ id: 'b' }), '', []).map((c) => c.name), ['fast'], 'offered until the agent says otherwise')
+ assert.deepEqual(slashCommands(normalizeBot({ id: 'b', fastModeSupport: 'unsupported' }), '', []), [], 'no Fast mode on offer')
assert.deepEqual(slashCommands(normalizeBot({ id: 'g', kind: 'group', fastModeSupport: 'offered' }), '', installed), [])
})
test('sending just a built-in command runs it; anything else is a message', () => {
const bot = normalizeBot({ id: 'b', fastModeSupport: 'offered' })
assert.equal(builtInCommand(bot, '/fast ')?.action.kind, 'fast')
- assert.equal(builtInCommand(bot, '/new')?.action.kind, 'newSession')
+ assert.equal(builtInCommand(bot, '/new'), null, 'reaches the agent as typed')
assert.equal(builtInCommand(bot, '/fast please'), null)
assert.equal(builtInCommand(normalizeBot({ id: 'b', fastModeSupport: 'unsupported' }), '/fast'), null, 'without Fast mode it reaches the agent')
})
test('Return runs the highlighted command, but sends a skill already typed out', () => {
- const bot = normalizeBot({ id: 'b', skills: ['pdf'], fastModeSupport: 'unsupported' })
- const [newSession, pdf] = slashCommands(bot, '', installed)
- assert.equal(returnRuns(newSession!, '/'), true)
+ const bot = normalizeBot({ id: 'b', skills: ['pdf'], fastModeSupport: 'offered' })
+ const [fast, pdf] = slashCommands(bot, '', installed)
+ assert.equal(returnRuns(fast!, '/'), true)
assert.equal(returnRuns(pdf!, '/pd'), true)
assert.equal(returnRuns(pdf!, '/pdf'), false)
})
diff --git a/apps/desktop/src/renderer/views/thread/slash-commands.ts b/apps/desktop/src/renderer/views/thread/slash-commands.ts
index a59ca966..028c7686 100644
--- a/apps/desktop/src/renderer/views/thread/slash-commands.ts
+++ b/apps/desktop/src/renderer/views/thread/slash-commands.ts
@@ -1,6 +1,5 @@
-// The composer's `/` commands, listed while the draft is just `/partial`: Fast mode and New
-// session run here through host methods (`updateBot`, `newSession`); a skill fills in
-// `/<id> `, and the host turns that message into "read this skill first"
+// The composer's `/` commands, listed while the draft is just `/partial`: Fast mode runs here
+// through the host's `updateBot` (a new session is in the bot's menu); a skill fills in `/<id> `, and the host turns that message into "read this skill first"
// (host/src/market/skills.rs `expand_command`). docs/features/marketplace.md, "Commands".
import { fastModeDetail, fastModeShown, fastModeState } from '../../../shared/fast-mode.ts'
import type { Bot } from '../../../shared/models.ts'
@@ -8,7 +7,7 @@ import type { Bot } from '../../../shared/models.ts'
/** The first host with `/skill` messages and skill details; older ones get the text as typed. */
export const SKILLS_HOST = '2.14.1'
-export type SlashAction = { kind: 'fast' } | { kind: 'newSession' } | { kind: 'skill'; id: string }
+export type SlashAction = { kind: 'fast' } | { kind: 'skill'; id: string }
export interface SlashCommand {
/** What follows the `/`. */
@@ -28,13 +27,9 @@ export function slashQuery(draft: string): string | null {
/** The bot's built-in commands; a group has none (each member has its own agent). */
function builtIn(bot: Bot): SlashCommand[] {
if (bot.kind === 'group') return []
- const fast: SlashCommand[] = fastModeShown(bot)
+ return fastModeShown(bot)
? [{ name: 'fast', icon: 'bolt', title: 'Fast mode', detail: fastModeDetail(bot), warning: fastModeState(bot) === 'refused', action: { kind: 'fast' } }]
: []
- return [
- ...fast,
- { name: 'new', icon: 'arrow.counterclockwise', title: 'New session', detail: 'Start over with a fresh context; the transcript stays', warning: false, action: { kind: 'newSession' } },
- ]
}
/** Built-in commands, then the bot's skills (ids in `bot.skills`), whose name or title holds `query`. */
@@ -47,7 +42,7 @@ export function slashCommands(bot: Bot | null, query: string, installedSkills: {
return [...builtIn(bot), ...skills].filter((c) => c.name.includes(q) || c.title.toLowerCase().includes(q))
}
-/** A draft that is just a built-in command (`/fast`, `/new`): sending it runs the command. */
+/** A draft that is just a built-in command (`/fast`): sending it runs the command. */
export function builtInCommand(bot: Bot | null, draft: string): SlashCommand | null {
const name = slashQuery(draft.trim())
return bot && name !== null ? (builtIn(bot).find((c) => c.name === name) ?? null) : null
diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
index fcbe6aea..c5845b47 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
@@ -348,9 +348,6 @@ struct Composer: View {
case .fast:
model.setFastMode(bot, !bot.fastMode)
draft = ""
- case .newSession:
- model.newSession(bot.id)
- draft = ""
case .skill(let id):
draft = "/\(id) "
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/SlashCommands.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/SlashCommands.swift
index 33ef3f49..ee29a6d2 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Thread/SlashCommands.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/SlashCommands.swift
@@ -2,7 +2,7 @@ import CodyncKit
/// A command in the composer's `/` list.
struct SlashCommand: Identifiable, Equatable {
- enum Action: Hashable { case fast, newSession, skill(String) }
+ enum Action: Hashable { case fast, skill(String) }
/// What follows the `/`.
let name: String
@@ -15,9 +15,8 @@ struct SlashCommand: Identifiable, Equatable {
var id: Action { action }
}
-/// The composer's `/` commands, listed while the draft is just `/partial`: Fast mode and New
-/// session run here through host methods (`updateBot`, `newSession`); a skill fills in
-/// `/<id> `, and the host turns that message into "read this skill first"
+/// The composer's `/` commands, listed while the draft is just `/partial`: Fast mode runs here
+/// through the host's `updateBot` (a new session is in the bot's menu); a skill fills in `/<id> `, and the host turns that message into "read this skill first"
/// (`host/src/market/skills.rs` `expand_command`). docs/features/marketplace.md, "Commands".
enum SlashCommands {
/// The first host that understands `/skill` messages; older ones get the text as typed.
@@ -40,21 +39,15 @@ enum SlashCommands {
}
}
- /// A draft that is just a built-in command (`/fast`, `/new`): sending it runs the command.
+ /// A draft that is just a built-in command (`/fast`): sending it runs the command.
static func builtIn(for bot: Bot?, draft: String) -> SlashCommand? {
guard let bot, let name = query(draft.trimmingCharacters(in: .whitespacesAndNewlines)) else { return nil }
return builtIn(bot).first { $0.name == name }
}
private static func builtIn(_ bot: Bot) -> [SlashCommand] {
- guard !bot.isGroup else { return [] }
- var commands: [SlashCommand] = []
- if bot.fastModeShown {
- commands.append(SlashCommand(name: "fast", icon: "bolt", title: "Fast mode", detail: bot.fastModeDetail,
- warning: bot.fastModeState == .refused, action: .fast))
- }
- commands.append(SlashCommand(name: "new", icon: "arrow.counterclockwise", title: "New session",
- detail: "Start over with a fresh context; the transcript stays", warning: false, action: .newSession))
- return commands
+ guard !bot.isGroup, bot.fastModeShown else { return [] }
+ return [SlashCommand(name: "fast", icon: "bolt", title: "Fast mode", detail: bot.fastModeDetail,
+ warning: bot.fastModeState == .refused, action: .fast)]
}
}
diff --git a/apps/ios/Kit/Tests/CodyncUITests/SlashCommandsTests.swift b/apps/ios/Kit/Tests/CodyncUITests/SlashCommandsTests.swift
index 9b9a3cf8..0bcac8bc 100644
--- a/apps/ios/Kit/Tests/CodyncUITests/SlashCommandsTests.swift
+++ b/apps/ios/Kit/Tests/CodyncUITests/SlashCommandsTests.swift
@@ -18,19 +18,19 @@ private let installed = [("pdf", "PDF"), ("code-review", "Code Review"), ("xlsx"
@Test func builtInCommandsComeFirstThenOnlyTheBotsOwnSkills() throws {
let offered = try bot(#"{"id":"b","skills":["pdf","code-review"],"fastModeSupport":"offered"}"#)
- #expect(SlashCommands.list(for: offered, query: "", skills: installed).map(\.name) == ["fast", "new", "pdf", "code-review"])
+ #expect(SlashCommands.list(for: offered, query: "", skills: installed).map(\.name) == ["fast", "pdf", "code-review"])
#expect(SlashCommands.list(for: offered, query: "review", skills: installed).map(\.name) == ["code-review"])
- #expect(SlashCommands.list(for: offered, query: "session", skills: installed).map(\.name) == ["new"])
+ #expect(SlashCommands.list(for: offered, query: "new", skills: installed).isEmpty, "a new session is in the bot's menu")
#expect(SlashCommands.list(for: try bot(#"{"id":"b","skills":["pdf"]}"#), query: "xl", skills: installed).isEmpty)
- #expect(SlashCommands.list(for: try bot(#"{"id":"b"}"#), query: "", skills: []).map(\.name) == ["fast", "new"], "offered until the agent says otherwise")
- #expect(SlashCommands.list(for: try bot(#"{"id":"b","fastModeSupport":"unsupported"}"#), query: "", skills: []).map(\.name) == ["new"], "no Fast mode on offer")
+ #expect(SlashCommands.list(for: try bot(#"{"id":"b"}"#), query: "", skills: []).map(\.name) == ["fast"], "offered until the agent says otherwise")
+ #expect(SlashCommands.list(for: try bot(#"{"id":"b","fastModeSupport":"unsupported"}"#), query: "", skills: []).isEmpty, "no Fast mode on offer")
#expect(SlashCommands.list(for: try bot(#"{"id":"g","kind":"group","fastModeSupport":"offered"}"#), query: "", skills: installed).isEmpty)
}
@Test func sendingJustABuiltInCommandRunsIt() throws {
let offered = try bot(#"{"id":"b","fastModeSupport":"offered"}"#)
#expect(SlashCommands.builtIn(for: offered, draft: "/fast ")?.action == .fast)
- #expect(SlashCommands.builtIn(for: offered, draft: "/new")?.action == .newSession)
+ #expect(SlashCommands.builtIn(for: offered, draft: "/new") == nil, "reaches the agent as typed")
#expect(SlashCommands.builtIn(for: offered, draft: "/fast please") == nil)
#expect(SlashCommands.builtIn(for: try bot(#"{"id":"b","fastModeSupport":"unsupported"}"#), draft: "/fast") == nil, "without Fast mode it reaches the agent")
}
diff --git a/docs/features/marketplace.md b/docs/features/marketplace.md
index 529e594f..b5ac7db9 100644
--- a/docs/features/marketplace.md
+++ b/docs/features/marketplace.md
@@ -34,10 +34,9 @@ Typing `/` at the start of a message to a bot (desktop, iPhone, terminal; not in
| Command | Title | Does |
| --- | --- | --- |
| `/fast` | Fast mode | Switches [Fast mode](#fast-mode) with `updateBot`; listed only while the bot offers it. Its detail says what picking it does, or why the agent refused it (warning color). |
-| `/new` | New session | `newSession`: the agent starts over with a fresh context and the transcript stays. No confirmation, unlike the bot menu's New session, because typing the command is the confirmation. |
| `/<skill id>` | the skill's name | Fills in `/<skill id> ` for the rest of the message. |
-Picking a built-in command, or sending a message that is just one (`/fast`, `/new`), runs it in the client and clears the box; nothing reaches the agent. Return on a skill whose name is already typed out sends the message. The host sees a message starting with `/<id of a skill the bot has on>` and hands the agent `[Codync: the user picked the "<name>" skill for this message. Read <path> first and follow it.]` followed by the rest of the message; the chat keeps the text as typed. Any other `/command`, including `/fast` for a bot without Fast mode on offer, reaches the agent unchanged, so its own commands keep working. Clients list skills and load skill instructions only from hosts 2.14.1 and newer.
+Picking a built-in command, or sending a message that is just one (`/fast`), runs it in the client and clears the box; nothing reaches the agent. Return on a skill whose name is already typed out sends the message. The host sees a message starting with `/<id of a skill the bot has on>` and hands the agent `[Codync: the user picked the "<name>" skill for this message. Read <path> first and follow it.]` followed by the rest of the message; the chat keeps the text as typed. Any other `/command`, including `/fast` for a bot without Fast mode on offer, reaches the agent unchanged, so its own commands keep working. Clients list skills and load skill instructions only from hosts 2.14.1 and newer.
## Sign-in for remote connectors (`host/src/market/oauth.rs`)
diff --git a/docs/plans/android-app.md b/docs/plans/android-app.md
index fe912d32..7b9e8313 100644
--- a/docs/plans/android-app.md
+++ b/docs/plans/android-app.md
@@ -18,7 +18,7 @@ emulator against a real host; device acceptance is listed separately.
| Accounts/access | Ported: account sheet and switcher, Computers & settings (connection status, badge color, Revoke this phone's access, older copies removed from the account), account computer access with its code, access banner, `codync-dev://computers` and `codync-dev://plugins` | Provider browser round trip on a device; Revoke and older copies against a signed-in account (covered by cloud request tests only); one computer per phone ([multiple computers are future work](../architecture/overview.md)) |
| Roster | Ported: rows, menus, pin/hide/delete, groups, drag to reorder (host-synced order) and TalkBack Move up/down, computer header, pull to refresh (also in Computers & settings) | Multiple computers |
| Conversation/threads | Ported: bubbles, Markdown/code, permissions, reactions, threads, Full conversation, bot-to-bot exchange lines and their conversation, routine notices that open their routine, files a bot shares (verified download, then the share sheet), sent images full size, pull down to reconnect, jump to latest, read receipts for every conversation on screen | Physical keyboard and TalkBack |
-| Composer | Ported: files/photos/paste (groups too, image thumbnails, Paste only when the clipboard holds files), `/` commands (Fast mode, New session, skills listed fresh on `/`), @mentions in groups, call/send/stop/interrupt button | — |
+| Composer | Ported: files/photos/paste (groups too, image thumbnails, Paste only when the clipboard holds files), `/` commands (Fast mode, skills listed fresh on `/`), @mentions in groups, call/send/stop/interrupt button | — |
| Bot and group editors | Ported: avatar, profile, agent and model options, Fast mode, workspace folder picker, permissions, activity, connectors, skills (with their details) | — |
| Memory | Ported: search, filters, add/edit, pin, review, history and timeline, export/import, forget all | — |
| Routines | Ported: list with switches, editor (schedule, webhook panel, run settings), test run, delete | Live provider/routine acceptance |
diff --git a/host/src/tui/app/slash.rs b/host/src/tui/app/slash.rs
index 58d99d77..fc6037da 100644
--- a/host/src/tui/app/slash.rs
+++ b/host/src/tui/app/slash.rs
@@ -1,6 +1,6 @@
-//! The composer's `/` commands, listed while the draft is just `/partial`: Fast mode and New
-//! session run here (`updateBot`, `newSession`); a skill fills in `/<id> `, which the host turns
-//! into "read this skill first" (`market::expand_command`).
+//! The composer's `/` commands, listed while the draft is just `/partial`: Fast mode runs here
+//! (`updateBot`; a new session is `S`); a skill fills in `/<id> `, which the host turns into "read
+//! this skill first" (`market::expand_command`).
use crossterm::event::{KeyCode, KeyEvent};
use serde_json::json;
@@ -11,7 +11,6 @@ use super::{After, App, Editor};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SlashAction {
Fast,
- NewSession,
Skill,
}
@@ -30,7 +29,7 @@ impl SlashCommand {
match self.action {
SlashAction::Skill if self.detail.is_empty() => self.title.clone(),
SlashAction::Skill => self.detail.replace('\n', " "),
- _ => format!("{} · {}", self.title, self.detail),
+ SlashAction::Fast => format!("{} · {}", self.title, self.detail),
}
}
}
@@ -45,13 +44,7 @@ impl App {
detail: bot.fast_detail(),
action: SlashAction::Fast,
});
- let new = SlashCommand {
- name: "new".into(),
- title: "New session".into(),
- detail: "Start over with a fresh context; the transcript stays".into(),
- action: SlashAction::NewSession,
- };
- fast.into_iter().chain([new]).collect()
+ fast.into_iter().collect()
}
/// Built-in commands, then the selected bot's skills, whose name or title holds the
@@ -108,7 +101,7 @@ impl App {
true
}
- /// A draft that is just a built-in command (`/fast`, `/new`) runs it instead of being sent.
+ /// A draft that is just a built-in command (`/fast`) runs it instead of being sent.
/// Returns whether it did.
pub(super) fn built_in_command(&mut self, text: &str) -> bool {
let Some(name) = text.strip_prefix('/') else { return false };
@@ -125,11 +118,6 @@ impl App {
self.flash(if fast { "Fast mode off" } else { "Fast mode on" });
String::new()
}
- SlashAction::NewSession => {
- self.call("newSession", json!({"botId": id}), After::Nothing);
- self.flash("New session");
- String::new()
- }
SlashAction::Skill => format!("/{} ", command.name),
};
if let Some(key) = self.draft_key() {
@@ -176,14 +164,14 @@ mod tests {
let mut app =
app_with(&json!({"id": "b", "name": "Bot", "skills": ["pdf", "docx"], "fastModeSupport": "offered"}));
app.drafts.insert("b".into(), super::Editor::with("/"));
- assert_eq!(names(&app), ["fast", "new", "pdf", "docx"], "only skills the bot has on");
- app.drafts.insert("b".into(), super::Editor::with("/session"));
- assert_eq!(names(&app), ["new"], "titles match too");
+ assert_eq!(names(&app), ["fast", "pdf", "docx"], "only skills the bot has on");
+ app.drafts.insert("b".into(), super::Editor::with("/new"));
+ assert!(names(&app).is_empty(), "a new session is S");
app.bots.get_mut("b").expect("the bot").fast_support = "unknown".into();
app.drafts.insert("b".into(), super::Editor::with("/"));
- assert_eq!(names(&app), ["fast", "new", "pdf", "docx"], "offered until the agent says otherwise");
+ assert_eq!(names(&app), ["fast", "pdf", "docx"], "offered until the agent says otherwise");
app.bots.get_mut("b").expect("the bot").fast_support = "unsupported".into();
- assert_eq!(names(&app), ["new", "pdf", "docx"], "no Fast mode on offer");
+ assert_eq!(names(&app), ["pdf", "docx"], "no Fast mode on offer");
}
#[tokio::test]
@@ -191,7 +179,7 @@ mod tests {
let mut app = app_with(&json!({"id": "b", "name": "Bot", "skills": ["pdf"], "fastModeSupport": "offered"}));
app.drafts.insert("b".into(), super::Editor::with("/"));
assert!(app.slash_key(key(KeyCode::Up)), "up wraps to the last row");
- assert_eq!(app.slash_selected(3), 2);
+ assert_eq!(app.slash_selected(2), 1);
assert!(app.slash_key(key(KeyCode::Enter)), "Return on a skill fills it in");
assert_eq!(app.draft().text, "/pdf ");
assert!(names(&app).is_empty(), "the list closes once the name is done");
@@ -206,7 +194,7 @@ mod tests {
async fn sending_just_a_built_in_command_runs_it() {
let mut app = app_with(&json!({"id": "b", "name": "Bot", "fastModeSupport": "offered"}));
assert!(!app.built_in_command("/fast please"), "only the bare command");
- assert!(app.built_in_command("/new"));
+ assert!(!app.built_in_command("/new"), "reaches the agent as typed");
assert!(app.built_in_command("/fast"));
app.bots.get_mut("b").expect("the bot").fast_support = "unsupported".into();
assert!(!app.built_in_command("/fast"), "without Fast mode it reaches the agent");
diff --git a/host/src/tui/view/help.rs b/host/src/tui/view/help.rs
index 73b76a83..0deea6ab 100644
--- a/host/src/tui/view/help.rs
+++ b/host/src/tui/view/help.rs
@@ -46,7 +46,7 @@ const HELP: [(&str, &str, &str); 60] = [
("TYPE", "alt b / f", "word left / right"),
("TYPE", "^w ^u", "delete word / line"),
("TYPE", "@name", "group: ask just that bot"),
- ("TYPE", "/", "commands: /fast, /new, skills"),
+ ("TYPE", "/", "commands: /fast, skills"),
("BOTS", "n", "new bot"),
("BOTS", "m", "new group chat"),
("BOTS", "e", "settings, or edit a group"),